aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_acceptor.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2015-11-24 12:19:38 +0100
committerHans Nilsson <[email protected]>2015-11-24 12:19:38 +0100
commit6cba6bb8a8261fa1c45ad58b9137ced87ef38dd9 (patch)
tree0dd8947017cf81e61d38c4c55a8b14cc47551b02 /lib/ssh/src/ssh_acceptor.erl
parent389bec721f51c392f9997fcc6f88f6e8f3616041 (diff)
parent3747f01d19676f6f8d5d8b0a05c9ddbf6d92be49 (diff)
downloadotp-6cba6bb8a8261fa1c45ad58b9137ced87ef38dd9.tar.gz
otp-6cba6bb8a8261fa1c45ad58b9137ced87ef38dd9.tar.bz2
otp-6cba6bb8a8261fa1c45ad58b9137ced87ef38dd9.zip
Merge branch 'maint'
* maint: ssh: testcases for starting daemon with given fd ssh: Make it possible for more than one daemon started with option fd
Diffstat (limited to 'lib/ssh/src/ssh_acceptor.erl')
-rw-r--r--lib/ssh/src/ssh_acceptor.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ssh/src/ssh_acceptor.erl b/lib/ssh/src/ssh_acceptor.erl
index c5ad1d7b6c..d94dedf1bf 100644
--- a/lib/ssh/src/ssh_acceptor.erl
+++ b/lib/ssh/src/ssh_acceptor.erl
@@ -56,7 +56,12 @@ acceptor_init(Parent, Port, Address, SockOpts, Opts, AcceptTimeout) ->
error
end.
-do_socket_listen(Callback, Port, Opts) ->
+do_socket_listen(Callback, Port0, Opts) ->
+ Port =
+ case proplists:get_value(fd, Opts) of
+ undefined -> Port0;
+ _ -> 0
+ end,
case Callback:listen(Port, Opts) of
{error, nxdomain} ->
Callback:listen(Port, lists:delete(inet6, Opts));