diff options
author | Micael Karlberg <[email protected]> | 2019-07-31 19:08:50 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2019-07-31 19:08:50 +0200 |
commit | f115892d729fd919b77f85855735398e90f801f0 (patch) | |
tree | 040bbd84d502bab5435ef7b5ccfb6c410ba7654c /lib/snmp/src/manager | |
parent | 6c4ad85880375b242ac48a2bf439887f503ce203 (diff) | |
download | otp-f115892d729fd919b77f85855735398e90f801f0.tar.gz otp-f115892d729fd919b77f85855735398e90f801f0.tar.bz2 otp-f115892d729fd919b77f85855735398e90f801f0.zip |
[snmp] Fixed agent|manager top supervisor stop
Diffstat (limited to 'lib/snmp/src/manager')
-rw-r--r-- | lib/snmp/src/manager/snmpm_supervisor.erl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/snmp/src/manager/snmpm_supervisor.erl b/lib/snmp/src/manager/snmpm_supervisor.erl index 0061488f54..bc66025c6f 100644 --- a/lib/snmp/src/manager/snmpm_supervisor.erl +++ b/lib/snmp/src/manager/snmpm_supervisor.erl @@ -38,6 +38,7 @@ %%%------------------------------------------------------------------- %%% API %%%------------------------------------------------------------------- + start_link(Type, Opts) -> ?d("start_link -> entry with" "~n Opts: ~p", [Opts]), @@ -62,17 +63,17 @@ stop(Timeout) -> %% a supervisor. The "normal" way to do it is: %% 1) exit(Pid, kill) (kaboom) %% 2) If the caller is the *parent*: exit(Pid, shutdown) -%% So, here we do it the really unly way...but since this function is +%% So, here we do it the really ugly way...but since this function is %% intended for testing (mostly)... stop(Pid, Timeout) when (Timeout =:= 0) -> ?d("stop -> Pid: ~p", [Pid]), - sys:terminate(whereis(?SERVER), shutdown), + sys:terminate(Pid, shutdown), ?d("stop -> stopped", []), ok; stop(Pid, Timeout) -> ?d("stop -> Pid: ~p", [Pid]), MRef = erlang:monitor(process, Pid), - sys:terminate(whereis(?SERVER), shutdown), + sys:terminate(Pid, shutdown), receive {'DOWN', MRef, process, Pid, _} -> ?d("stop -> stopped", []), |