aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_sftp.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2018-06-21 10:38:51 +0200
committerHans Nilsson <[email protected]>2018-06-21 10:41:34 +0200
commit182c7b954620e9287ba2ddce9b1cbaceb1bddbaf (patch)
tree33d427c5f4712bbe6ffc90d7e90290e8a290d3aa /lib/ssh/src/ssh_sftp.erl
parentdb6059a9217767a6e42e93cec05089c0ec977d20 (diff)
downloadotp-182c7b954620e9287ba2ddce9b1cbaceb1bddbaf.tar.gz
otp-182c7b954620e9287ba2ddce9b1cbaceb1bddbaf.tar.bz2
otp-182c7b954620e9287ba2ddce9b1cbaceb1bddbaf.zip
ssh: Bug fix sftp error codes
Report the signal name if the signal error message is "" Do not report a return code of 0 as an error.
Diffstat (limited to 'lib/ssh/src/ssh_sftp.erl')
-rw-r--r--lib/ssh/src/ssh_sftp.erl13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/ssh/src/ssh_sftp.erl b/lib/ssh/src/ssh_sftp.erl
index 9e1229dc85..79586141b2 100644
--- a/lib/ssh/src/ssh_sftp.erl
+++ b/lib/ssh/src/ssh_sftp.erl
@@ -801,13 +801,22 @@ handle_ssh_msg({ssh_cm, _, {signal, _, _}}, State) ->
%% Ignore signals according to RFC 4254 section 6.9.
{ok, State};
-handle_ssh_msg({ssh_cm, _, {exit_signal, ChannelId, _, Error, _}},
+handle_ssh_msg({ssh_cm, _, {exit_signal, ChannelId, Signal, Error0, _}},
State0) ->
+ Error =
+ case Error0 of
+ "" -> Signal;
+ _ -> Error0
+ end,
State = reply_all(State0, {error, Error}),
{stop, ChannelId, State};
handle_ssh_msg({ssh_cm, _, {exit_status, ChannelId, Status}}, State0) ->
- State = reply_all(State0, {error, {exit_status, Status}}),
+ State =
+ case State0 of
+ 0 -> State0;
+ _ -> reply_all(State0, {error, {exit_status, Status}})
+ end,
{stop, ChannelId, State}.
%%--------------------------------------------------------------------