aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-02-15 15:13:54 +0100
committerHans Nilsson <[email protected]>2017-02-15 15:13:54 +0100
commitcd88d70ffb0f325fa84c8548b3dca1f7865ee86d (patch)
tree3faf961a568ce32ed740c53c86bcfcba7f674dae
parentd21031900160a70408f0ee6f1b2f8bd01f1cbde7 (diff)
downloadotp-cd88d70ffb0f325fa84c8548b3dca1f7865ee86d.tar.gz
otp-cd88d70ffb0f325fa84c8548b3dca1f7865ee86d.tar.bz2
otp-cd88d70ffb0f325fa84c8548b3dca1f7865ee86d.zip
ssh: More exact test for is_tcp_socket
-rw-r--r--lib/ssh/src/ssh.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl
index 8d8e20730d..657cf4c62d 100644
--- a/lib/ssh/src/ssh.erl
+++ b/lib/ssh/src/ssh.erl
@@ -280,9 +280,11 @@ valid_socket_to_use(Socket, Options) ->
{error, {unsupported,L4}}
end.
-is_tcp_socket(Socket) -> {ok,[]} =/= inet:getopts(Socket, [delay_send]).
-
-
+is_tcp_socket(Socket) ->
+ case inet:getopts(Socket, [delay_send]) of
+ {ok,[_]} -> true;
+ _ -> false
+ end.
daemon_shell_opt(Options) ->
case proplists:get_value(shell, Options) of