aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_connection_handler.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2014-12-17 09:52:11 +0100
committerIngela Anderton Andin <[email protected]>2014-12-17 09:52:11 +0100
commit134d058112f81629b1ab556711ca1dc1a5a6c952 (patch)
treebb973ea591bf45aef5cb27e2452dfa4a11164e7b /lib/ssh/src/ssh_connection_handler.erl
parentbda15be54eb444099ebdd073988ab4b6dcfdda93 (diff)
parent7c657ba949e51d6d176af82a5e56f9e68f5a3b1c (diff)
downloadotp-134d058112f81629b1ab556711ca1dc1a5a6c952.tar.gz
otp-134d058112f81629b1ab556711ca1dc1a5a6c952.tar.bz2
otp-134d058112f81629b1ab556711ca1dc1a5a6c952.zip
Merge branch 'maint'
Diffstat (limited to 'lib/ssh/src/ssh_connection_handler.erl')
-rw-r--r--lib/ssh/src/ssh_connection_handler.erl15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl
index fdb9d3b3e6..915060c426 100644
--- a/lib/ssh/src/ssh_connection_handler.erl
+++ b/lib/ssh/src/ssh_connection_handler.erl
@@ -289,8 +289,13 @@ renegotiate_data(ConnectionHandler) ->
-spec close(pid(), channel_id()) -> ok.
%%--------------------------------------------------------------------
close(ConnectionHandler, ChannelId) ->
- sync_send_all_state_event(ConnectionHandler, {close, ChannelId}).
-
+ case sync_send_all_state_event(ConnectionHandler, {close, ChannelId}) of
+ ok ->
+ ok;
+ {error, closed} ->
+ ok
+ end.
+
%%--------------------------------------------------------------------
-spec stop(pid()) -> ok | {error, term()}.
%%--------------------------------------------------------------------
@@ -1204,7 +1209,11 @@ sync_send_all_state_event(FsmPid, Event) ->
sync_send_all_state_event(FsmPid, Event, infinity).
sync_send_all_state_event(FsmPid, Event, Timeout) ->
- try gen_fsm:sync_send_all_state_event(FsmPid, Event, Timeout)
+ try gen_fsm:sync_send_all_state_event(FsmPid, Event, Timeout) of
+ {closed, _Channel} ->
+ {error, closed};
+ Result ->
+ Result
catch
exit:{noproc, _} ->
{error, closed};