Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
1126-snmp-agent-Add-explicit-socket-s-close-whe...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1126-snmp-agent-Add-explicit-socket-s-close-when-terminat.patch of Package erlang
From 484b3bb9668054854c6fb2c0682e629d75d04507 Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Fri, 2 Dec 2022 19:55:49 +0100 Subject: [PATCH 1/2] [snmp|agent] Add explicit socket(s) close when terminating net-if OTP-18352 --- lib/snmp/src/agent/snmpa_net_if.erl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/snmp/src/agent/snmpa_net_if.erl b/lib/snmp/src/agent/snmpa_net_if.erl index bd19a32159..bd9c1e0c03 100644 --- a/lib/snmp/src/agent/snmpa_net_if.erl +++ b/lib/snmp/src/agent/snmpa_net_if.erl @@ -1900,9 +1900,18 @@ handle_set_request_limit(State, BadLimit) -> system_continue(_Parent, _Dbg, S) -> loop(S). -system_terminate(Reason, _Parent, _Dbg, #state{log = Log}) -> +system_terminate(Reason, _Parent, _Dbg, #state{log = Log, + transports = Transports}) -> ?vlog("system-terminate -> entry with" "~n Reason: ~p", [Reason]), + %% Close all transports + Close = + fun(S) -> + ?vlog("try close socket ~p", [S]), + (catch gen_udp:close(S)) + end, + _ = [Close(Socket) || #transport{socket = Socket} <- Transports], + %% Close logs do_close_log(Log), exit(Reason). -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor