aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/inet.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kernel/src/inet.erl')
-rw-r--r--lib/kernel/src/inet.erl16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/kernel/src/inet.erl b/lib/kernel/src/inet.erl
index 0bb5444dbb..41460c948b 100644
--- a/lib/kernel/src/inet.erl
+++ b/lib/kernel/src/inet.erl
@@ -535,7 +535,7 @@ options() ->
buffer, header, active, packet, deliver, mode,
multicast_if, multicast_ttl, multicast_loop,
exit_on_close, high_watermark, low_watermark,
- bit8, send_timeout, send_timeout_close
+ send_timeout, send_timeout_close
].
%% Return a list of statistics options
@@ -552,7 +552,7 @@ stats() ->
connect_options() ->
[tos, priority, reuseaddr, keepalive, linger, sndbuf, recbuf, nodelay,
header, active, packet, packet_size, buffer, mode, deliver,
- exit_on_close, high_watermark, low_watermark, bit8, send_timeout,
+ exit_on_close, high_watermark, low_watermark, send_timeout,
send_timeout_close, delay_send,raw].
connect_options(Opts, Family) ->
@@ -608,7 +608,7 @@ con_add(Name, Val, R, Opts, AllOpts) ->
listen_options() ->
[tos, priority, reuseaddr, keepalive, linger, sndbuf, recbuf, nodelay,
header, active, packet, buffer, mode, deliver, backlog,
- exit_on_close, high_watermark, low_watermark, bit8, send_timeout,
+ exit_on_close, high_watermark, low_watermark, send_timeout,
send_timeout_close, delay_send, packet_size,raw].
listen_options(Opts, Family) ->
@@ -1255,7 +1255,10 @@ tcp_controlling_process(S, NewOwner) when is_port(S), is_pid(NewOwner) ->
_ ->
case prim_inet:getopt(S, active) of
{ok, A0} ->
- prim_inet:setopt(S, active, false),
+ case A0 of
+ false -> ok;
+ _ -> prim_inet:setopt(S, active, false)
+ end,
case tcp_sync_input(S, NewOwner, false) of
true -> %% socket already closed,
ok;
@@ -1263,7 +1266,10 @@ tcp_controlling_process(S, NewOwner) when is_port(S), is_pid(NewOwner) ->
try erlang:port_connect(S, NewOwner) of
true ->
unlink(S), %% unlink from port
- prim_inet:setopt(S, active, A0),
+ case A0 of
+ false -> ok;
+ _ -> prim_inet:setopt(S, active, A0)
+ end,
ok
catch
error:Reason ->