aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_system_sup.erl
diff options
context:
space:
mode:
authornick <[email protected]>2010-09-02 16:47:06 +0200
committernick <[email protected]>2010-09-02 16:54:15 +0200
commitfddc1ed0341d13df8373509fa063d889fab8d219 (patch)
tree8baab4861e76be7f022497f9212247814b7f9368 /lib/ssh/src/ssh_system_sup.erl
parent6c61c2169e635bcf100e128096f66a9334035c7b (diff)
downloadotp-fddc1ed0341d13df8373509fa063d889fab8d219.tar.gz
otp-fddc1ed0341d13df8373509fa063d889fab8d219.tar.bz2
otp-fddc1ed0341d13df8373509fa063d889fab8d219.zip
Fix race condition when terminating a connection.
Diffstat (limited to 'lib/ssh/src/ssh_system_sup.erl')
-rw-r--r--lib/ssh/src/ssh_system_sup.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/ssh/src/ssh_system_sup.erl b/lib/ssh/src/ssh_system_sup.erl
index 9336f59444..0ff73f1648 100644
--- a/lib/ssh/src/ssh_system_sup.erl
+++ b/lib/ssh/src/ssh_system_sup.erl
@@ -33,7 +33,8 @@
stop_system/2, system_supervisor/2,
subsystem_supervisor/1, channel_supervisor/1,
connection_supervisor/1,
- acceptor_supervisor/1, start_subsystem/2, restart_subsystem/2, restart_acceptor/2, stop_subsystem/2]).
+ acceptor_supervisor/1, start_subsystem/2, restart_subsystem/2,
+ restart_acceptor/2, stop_subsystem/2]).
%% Supervisor callback
-export([init/1]).
@@ -90,6 +91,12 @@ stop_subsystem(SystemSup, SubSys) ->
{Id, _, _, _} ->
spawn(fun() -> supervisor:terminate_child(SystemSup, Id),
supervisor:delete_child(SystemSup, Id) end),
+ ok;
+ {'EXIT', {noproc, _}} ->
+ %% Already terminated; probably shutting down.
+ ok;
+ {'EXIT', {shutdown, _}} ->
+ %% Already shutting down.
ok
end.