aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_acceptor.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2015-11-18 17:35:59 +0100
committerHans Nilsson <[email protected]>2015-11-19 11:56:14 +0100
commit98ebbee6fa562d6812c1f132205e122b4ff4db3d (patch)
treee302f9e31bf53bf3e1ff4767358a0c1590370969 /lib/ssh/src/ssh_acceptor.erl
parentd4a3296ba3117315343057715ee428490e992ef0 (diff)
downloadotp-98ebbee6fa562d6812c1f132205e122b4ff4db3d.tar.gz
otp-98ebbee6fa562d6812c1f132205e122b4ff4db3d.tar.bz2
otp-98ebbee6fa562d6812c1f132205e122b4ff4db3d.zip
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));