aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_system_sup.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2013-11-22 14:54:43 +0100
committerIngela Anderton Andin <[email protected]>2013-11-26 12:24:25 +0100
commite4653d52abd98628fb862a8b01ea804473bdb338 (patch)
treeaa4263814d11aeca186f07ac4fc9485afcb9fa6f /lib/ssh/src/ssh_system_sup.erl
parent90c8450bb691a7b57ce326fddd1f44ef01db390f (diff)
downloadotp-e4653d52abd98628fb862a8b01ea804473bdb338.tar.gz
otp-e4653d52abd98628fb862a8b01ea804473bdb338.tar.bz2
otp-e4653d52abd98628fb862a8b01ea804473bdb338.zip
ssh: Correct close handling
Commit 68263a48bfbdac4dc219a91f06af3d535d881850 got close handling slightly wrong, channels did not get their close message. Commit 32102f1e8225dada7526c9bfee6622f9026ba4cd did not work as expected
Diffstat (limited to 'lib/ssh/src/ssh_system_sup.erl')
-rw-r--r--lib/ssh/src/ssh_system_sup.erl15
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,