aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_cli.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2016-09-28 12:19:27 +0200
committerHans Nilsson <[email protected]>2016-09-28 12:19:27 +0200
commit4b2616519b62ad2792d21f4138ea1544ce93d60e (patch)
tree7b403693eeb00a5733c641bd022b7f66eaa3f370 /lib/ssh/src/ssh_cli.erl
parent9342b2a38ba6637fe41b5b484f70e8a2a67dfeb4 (diff)
parenta8735970c9f02acd5de984a353de79a089f01bf1 (diff)
downloadotp-4b2616519b62ad2792d21f4138ea1544ce93d60e.tar.gz
otp-4b2616519b62ad2792d21f4138ea1544ce93d60e.tar.bz2
otp-4b2616519b62ad2792d21f4138ea1544ce93d60e.zip
Merge branch 'maint'
Diffstat (limited to 'lib/ssh/src/ssh_cli.erl')
-rw-r--r--lib/ssh/src/ssh_cli.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/ssh/src/ssh_cli.erl b/lib/ssh/src/ssh_cli.erl
index 74cd2e081a..8af0ecc5f9 100644
--- a/lib/ssh/src/ssh_cli.erl
+++ b/lib/ssh/src/ssh_cli.erl
@@ -208,8 +208,15 @@ handle_msg({Group, Req}, #state{group = Group, buf = Buf, pty = Pty,
write_chars(ConnectionHandler, ChannelId, Chars),
{ok, State#state{buf = NewBuf}};
-handle_msg({'EXIT', Group, _Reason}, #state{group = Group,
- channel = ChannelId} = State) ->
+handle_msg({'EXIT', Group, Reason}, #state{group = Group,
+ cm = ConnectionHandler,
+ channel = ChannelId} = State) ->
+ Status = case Reason of
+ normal -> 0;
+ _ -> -1
+ end,
+ ssh_connection:exit_status(ConnectionHandler, ChannelId, Status),
+ ssh_connection:send_eof(ConnectionHandler, ChannelId),
{stop, ChannelId, State};
handle_msg(_, State) ->