aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src
diff options
context:
space:
mode:
authorNiclas Eklund <[email protected]>2011-06-21 16:23:36 +0200
committerNiclas Eklund <[email protected]>2011-06-21 16:23:36 +0200
commitb331676b2fa755d767fc51b65ed6d99e1c20d7a2 (patch)
treef075cca50ddae4e08d18e26b6ebdf0ae3799c1fd /lib/ssh/src
parent5eec30647ab41ad9a0c9911d2e4e300ecb501333 (diff)
downloadotp-b331676b2fa755d767fc51b65ed6d99e1c20d7a2.tar.gz
otp-b331676b2fa755d767fc51b65ed6d99e1c20d7a2.tar.bz2
otp-b331676b2fa755d767fc51b65ed6d99e1c20d7a2.zip
OTP-9386 - Calling ssh_sftp:stop_channel/1 resulted in that the trap_exit flag was set to true for the invoking process.
Diffstat (limited to 'lib/ssh/src')
-rw-r--r--lib/ssh/src/ssh.appup.src10
-rwxr-xr-xlib/ssh/src/ssh_sftp.erl10
2 files changed, 13 insertions, 7 deletions
diff --git a/lib/ssh/src/ssh.appup.src b/lib/ssh/src/ssh.appup.src
index 974145836c..150b7d86dd 100644
--- a/lib/ssh/src/ssh.appup.src
+++ b/lib/ssh/src/ssh.appup.src
@@ -19,13 +19,19 @@
{"%VSN%",
[
- {"2.0.6", [{load_module, ssh_userreg, soft_purge, soft_purge, []}]},
+ {"2.0.7", [{load_module, ssh_sftp, soft_purge, soft_purge, []}]},
+ {"2.0.6", [{load_module, ssh_userreg, soft_purge, soft_purge, []},
+ {load_module, ssh_sftp, soft_purge, soft_purge, []}]},
{"2.0.5", [{load_module, ssh_userreg, soft_purge, soft_purge, []},
+ {load_module, ssh_sftp, soft_purge, soft_purge, []},
{load_module, ssh_connection_handler, soft_purge, soft_purge, [ssh_userreg]}]}
],
[
- {"2.0.6", [{load_module, ssh_userreg, soft_purge, soft_purge, []}]},
+ {"2.0.7", [{load_module, ssh_sftp, soft_purge, soft_purge, []}]},
+ {"2.0.6", [{load_module, ssh_userreg, soft_purge, soft_purge, []},
+ {load_module, ssh_sftp, soft_purge, soft_purge, []}]},
{"2.0.5", [{load_module, ssh_userreg, soft_purge, soft_purge, []},
+ {load_module, ssh_sftp, soft_purge, soft_purge, []},
{load_module, ssh_connection_handler, soft_purge, soft_purge, [ssh_userreg]}]}
]
}.
diff --git a/lib/ssh/src/ssh_sftp.erl b/lib/ssh/src/ssh_sftp.erl
index 59e09fdd0f..d09f497588 100755
--- a/lib/ssh/src/ssh_sftp.erl
+++ b/lib/ssh/src/ssh_sftp.erl
@@ -130,9 +130,9 @@ start_channel(Host, Port, Opts) ->
end.
stop_channel(Pid) ->
- case process_info(Pid, [trap_exit]) of
- [{trap_exit, Bool}] ->
- process_flag(trap_exit, true),
+ case is_process_alive(Pid) of
+ true ->
+ OldValue = process_flag(trap_exit, true),
link(Pid),
exit(Pid, ssh_sftp_stop_channel),
receive
@@ -145,9 +145,9 @@ stop_channel(Pid) ->
ok
end
end,
- process_flag(trap_exit, Bool),
+ process_flag(trap_exit, OldValue),
ok;
- undefined ->
+ false ->
ok
end.