aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded/src/prim_inet.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2014-07-22 18:01:19 +0200
committerErlang/OTP <[email protected]>2014-07-22 18:01:19 +0200
commit52810718bcd607ebb538036bdbb87b5e94634984 (patch)
treeb6cc19578e968c38a2510585e481b98c279bf7c4 /erts/preloaded/src/prim_inet.erl
parent450f0f893b5d28e6d967b163111f8a8a6032b0e1 (diff)
parenta60f3d879dfcdd018f1fea20790be901fbafeae4 (diff)
downloadotp-52810718bcd607ebb538036bdbb87b5e94634984.tar.gz
otp-52810718bcd607ebb538036bdbb87b5e94634984.tar.bz2
otp-52810718bcd607ebb538036bdbb87b5e94634984.zip
Merge branch 'lukas/kernel/bind_with_fdopen/OTP-12061' into maint-r16
* lukas/kernel/bind_with_fdopen/OTP-12061: Fix default behaviour for legacy fdopen erts: Fix inet close on prebound fds kernel: When doing an fdopen we now also bind the fd to the specified addr/port
Diffstat (limited to 'erts/preloaded/src/prim_inet.erl')
-rw-r--r--erts/preloaded/src/prim_inet.erl9
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),