diff options
author | Lukas Larsson <[email protected]> | 2014-07-11 10:46:37 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2014-07-22 09:29:22 +0200 |
commit | 8a6390613225ec3f3e2d5bbf537d2e0737342e87 (patch) | |
tree | a89fa6a8466484f4d3e91793659dc77763af5565 /erts/preloaded/src | |
parent | 450f0f893b5d28e6d967b163111f8a8a6032b0e1 (diff) | |
download | otp-8a6390613225ec3f3e2d5bbf537d2e0737342e87.tar.gz otp-8a6390613225ec3f3e2d5bbf537d2e0737342e87.tar.bz2 otp-8a6390613225ec3f3e2d5bbf537d2e0737342e87.zip |
kernel: When doing an fdopen we now also bind the fd to the specified addr/port
Diffstat (limited to 'erts/preloaded/src')
-rw-r--r-- | erts/preloaded/src/prim_inet.erl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/erts/preloaded/src/prim_inet.erl b/erts/preloaded/src/prim_inet.erl index a9df75327c..e3ba8a328a 100644 --- a/erts/preloaded/src/prim_inet.erl +++ b/erts/preloaded/src/prim_inet.erl @@ -25,7 +25,7 @@ %% Primitive inet_drv interface --export([open/3, open/4, fdopen/4, close/1]). +-export([open/3, open/4, fdopen/4, fdopen/5, close/1]). -export([bind/3, listen/1, listen/2, peeloff/2]). -export([connect/3, connect/4, async_connect/4]). -export([accept/1, accept/2, async_accept/2]). @@ -70,7 +70,12 @@ open(Protocol, Family, Type, Opts) -> open(Protocol, Family, Type, Opts, ?INET_REQ_OPEN, []). fdopen(Protocol, Family, Type, Fd) when is_integer(Fd) -> - open(Protocol, Family, Type, [], ?INET_REQ_FDOPEN, ?int32(Fd)). + fdopen(Protocol, Family, Type, Fd, true). + +fdopen(Protocol, Family, Type, Fd, Bound) + when is_integer(Fd), Bound == true orelse Bound == false -> + open(Protocol, Family, Type, [], ?INET_REQ_FDOPEN, + [?int32(Fd), enc_value_2(bool, Bound)]). open(Protocol, Family, Type, Opts, Req, Data) -> Drv = protocol2drv(Protocol), |