aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2015-04-15 19:24:08 +0200
committerIngela Anderton Andin <[email protected]>2015-04-15 19:24:08 +0200
commiteff81b18db74e1d22db82d7d299e77cf5cf99a55 (patch)
tree54d9f0609fdf681b1e6b2a1c66a5f76a25bd873c /lib
parent0fc485a1b487f0b22daf2178e28b2f3edfdc7919 (diff)
parentfee64d33a788bf6e32a53e1d665c498c86004980 (diff)
downloadotp-eff81b18db74e1d22db82d7d299e77cf5cf99a55.tar.gz
otp-eff81b18db74e1d22db82d7d299e77cf5cf99a55.tar.bz2
otp-eff81b18db74e1d22db82d7d299e77cf5cf99a55.zip
Merge branch 'ia/ssh/channel-gracefull-shutdown/OTP-12648'
* ia/ssh/channel-gracefull-shutdown/OTP-12648: ssh: Shutdown sftp channel gracefully
Diffstat (limited to 'lib')
-rw-r--r--lib/ssh/src/ssh_sftp.erl13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/ssh/src/ssh_sftp.erl b/lib/ssh/src/ssh_sftp.erl
index 613f8f25b2..c264eabc78 100644
--- a/lib/ssh/src/ssh_sftp.erl
+++ b/lib/ssh/src/ssh_sftp.erl
@@ -111,7 +111,7 @@ start_channel(Cm, Opts) when is_pid(Cm) ->
TimeOut
end;
{error, Reason} ->
- {error, Reason};
+ {error, format_channel_start_error(Reason)};
ignore ->
{error, ignore}
end;
@@ -136,7 +136,7 @@ start_channel(Host, Port, Opts) ->
TimeOut
end;
{error, Reason} ->
- {error, Reason};
+ {error, format_channel_start_error(Reason)};
ignore ->
{error, ignore}
end;
@@ -491,9 +491,9 @@ init([Cm, ChannelId, Options]) ->
inf = new_inf(),
opts = Options}};
failure ->
- {stop, "server failed to start sftp subsystem"};
+ {stop, {shutdown, "server failed to start sftp subsystem"}};
Error ->
- {stop, Error}
+ {stop, {shutdown, Error}}
end.
%%--------------------------------------------------------------------
@@ -1412,3 +1412,8 @@ open_buf1(Pid, BufInfo0, FileOpTimeout, CryptoState, ChunkSize) ->
BufHandle = make_ref(),
call(Pid, {put_bufinf,BufHandle,BufInfo}, FileOpTimeout),
{ok,BufHandle}.
+
+format_channel_start_error({shutdown, Reason}) ->
+ Reason;
+format_channel_start_error(Reason) ->
+ Reason.