aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/inet.erl
diff options
context:
space:
mode:
authorHenrik Nord <[email protected]>2014-07-22 17:37:52 +0200
committerHenrik Nord <[email protected]>2014-07-22 17:37:52 +0200
commita60f3d879dfcdd018f1fea20790be901fbafeae4 (patch)
treeb6cc19578e968c38a2510585e481b98c279bf7c4 /lib/kernel/src/inet.erl
parent03a1fcf5346233f76c8dc50844e132f4760154d6 (diff)
downloadotp-a60f3d879dfcdd018f1fea20790be901fbafeae4.tar.gz
otp-a60f3d879dfcdd018f1fea20790be901fbafeae4.tar.bz2
otp-a60f3d879dfcdd018f1fea20790be901fbafeae4.zip
Fix default behaviour for legacy fdopen
Update testcase for gen_udp:open/2 with option fd
Diffstat (limited to 'lib/kernel/src/inet.erl')
-rw-r--r--lib/kernel/src/inet.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/kernel/src/inet.erl b/lib/kernel/src/inet.erl
index 74fc7b0ac6..35236f4cb3 100644
--- a/lib/kernel/src/inet.erl
+++ b/lib/kernel/src/inet.erl
@@ -1287,10 +1287,11 @@ change_bindx_0_port({_IP, _Port}=Addr, _AssignedPort) ->
{'ok', socket()} | {'error', posix()}.
fdopen(Fd, Opts, Protocol, Family, Type, Module) ->
- fdopen(Fd, undefined, 0, Opts, Protocol, Family, Type, Module).
+ fdopen(Fd, any, 0, Opts, Protocol, Family, Type, Module).
fdopen(Fd, Addr, Port, Opts, Protocol, Family, Type, Module) ->
- IsAnyAddr = (Addr == {0,0,0,0} orelse Addr == {0,0,0,0,0,0,0,0}),
+ IsAnyAddr = (Addr == {0,0,0,0} orelse Addr == {0,0,0,0,0,0,0,0}
+ orelse Addr == any),
Bound = Port == 0 andalso IsAnyAddr,
case prim_inet:fdopen(Protocol, Family, Type, Fd, Bound) of
{ok, S} ->