aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2012-07-05 15:58:22 +0200
committerSverker Eriksson <[email protected]>2012-07-05 15:58:22 +0200
commit13fb710888b866830b673d019485ad58756fd23f (patch)
tree0f0545a0910b07ad1158b171cbdcea64c3df5ade /lib
parent2d519dc7ff781693451f6432e29fe55864bce482 (diff)
parent4ce6c4d5618ae8cfb39f8c08fb1cf937fc9db09a (diff)
downloadotp-13fb710888b866830b673d019485ad58756fd23f.tar.gz
otp-13fb710888b866830b673d019485ad58756fd23f.tar.bz2
otp-13fb710888b866830b673d019485ad58756fd23f.zip
Merge branch 'sverk/opt-inet-tcp-ctrl-proc'
* sverk/opt-inet-tcp-ctrl-proc: Optimize inet:tcp_controlling_process erts: Update obsolete HARD_DEBUG code
Diffstat (limited to 'lib')
-rw-r--r--lib/kernel/src/inet.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/kernel/src/inet.erl b/lib/kernel/src/inet.erl
index a651e82122..41460c948b 100644
--- a/lib/kernel/src/inet.erl
+++ b/lib/kernel/src/inet.erl
@@ -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 ->