aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_connection_sup.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2012-08-29 09:47:55 +0200
committerIngela Anderton Andin <[email protected]>2012-08-29 09:47:55 +0200
commit51f7937ef20f1b577223cef9c95a28c3bfdffbfa (patch)
tree5d9f790a969abb71ef70de546c997a2ff840b1e4 /lib/ssh/src/ssh_connection_sup.erl
parent479784883bfddb31c47b900ab03f03fc83f05970 (diff)
parent0080be4a20c094ef45dde842ace64f16d5dc22b2 (diff)
downloadotp-51f7937ef20f1b577223cef9c95a28c3bfdffbfa.tar.gz
otp-51f7937ef20f1b577223cef9c95a28c3bfdffbfa.tar.bz2
otp-51f7937ef20f1b577223cef9c95a28c3bfdffbfa.zip
Merge remote branch 'upstream/maint'
* upstream/maint: ssh: Prepare for release ssh: Correct error handling of ssh connect ssh: Use the correct channel id when adjusting the channel window
Diffstat (limited to 'lib/ssh/src/ssh_connection_sup.erl')
-rw-r--r--lib/ssh/src/ssh_connection_sup.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/ssh/src/ssh_connection_sup.erl b/lib/ssh/src/ssh_connection_sup.erl
index e3544af1c6..b620056310 100644
--- a/lib/ssh/src/ssh_connection_sup.erl
+++ b/lib/ssh/src/ssh_connection_sup.erl
@@ -48,8 +48,12 @@ start_manager_child(Sup, Args) ->
supervisor:start_child(Sup, Spec).
connection_manager(SupPid) ->
- Children = supervisor:which_children(SupPid),
- {ok, ssh_connection_manager(Children)}.
+ try supervisor:which_children(SupPid) of
+ Children ->
+ {ok, ssh_connection_manager(Children)}
+ catch exit:{noproc,_} ->
+ {ok, undefined}
+ end.
%%%=========================================================================
%%% Supervisor callback
@@ -107,6 +111,8 @@ handler_spec([Role, Socket, Opts]) ->
Type = worker,
{Name, StartFunc, Restart, Shutdown, Type, Modules}.
+ssh_connection_manager([]) ->
+ undefined;
ssh_connection_manager([{_, Child, _, [ssh_connection_manager]} | _]) ->
Child;
ssh_connection_manager([_ | Rest]) ->