diff options
author | Ingela Anderton Andin <[email protected]> | 2013-11-27 08:16:45 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2013-11-27 08:16:45 +0100 |
commit | 22e2b396e2fabe27c5a74843495c3eaf6900e211 (patch) | |
tree | 34fd7872933587f6c50e574a669ca96aa2687357 /lib/ssh/src/ssh_system_sup.erl | |
parent | 8852c947d413e8814d663c9319f7b8932b05a7ad (diff) | |
parent | e4653d52abd98628fb862a8b01ea804473bdb338 (diff) | |
download | otp-22e2b396e2fabe27c5a74843495c3eaf6900e211.tar.gz otp-22e2b396e2fabe27c5a74843495c3eaf6900e211.tar.bz2 otp-22e2b396e2fabe27c5a74843495c3eaf6900e211.zip |
Merge branch 'ia/ssh/close/OTP-11363' into maint
* ia/ssh/close/OTP-11363:
ssh: Correct close handling
Diffstat (limited to 'lib/ssh/src/ssh_system_sup.erl')
-rw-r--r-- | lib/ssh/src/ssh_system_sup.erl | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/ssh/src/ssh_system_sup.erl b/lib/ssh/src/ssh_system_sup.erl index bf3c12a988..848133f838 100644 --- a/lib/ssh/src/ssh_system_sup.erl +++ b/lib/ssh/src/ssh_system_sup.erl @@ -54,13 +54,16 @@ stop_listener(SysSup) -> stop_listener(Address, Port) -> Name = make_name(Address, Port), stop_acceptor(whereis(Name)). - -stop_system(SysSup) when is_pid(SysSup)-> - exit(SysSup, shutdown). + +stop_system(SysSup) -> + Name = sshd_sup:system_name(SysSup), + spawn(fun() -> sshd_sup:stop_child(Name) end), + ok. stop_system(Address, Port) -> - stop_system(system_supervisor(Address, Port)). - + spawn(fun() -> sshd_sup:stop_child(Address, Port) end), + ok. + system_supervisor(Address, Port) -> Name = make_name(Address, Port), whereis(Name). @@ -136,7 +139,7 @@ ssh_acceptor_child_spec(ServerOpts) -> Port = proplists:get_value(port, ServerOpts), Name = id(ssh_acceptor_sup, Address, Port), StartFunc = {ssh_acceptor_sup, start_link, [ServerOpts]}, - Restart = permanent, + Restart = transient, Shutdown = infinity, Modules = [ssh_acceptor_sup], Type = supervisor, |