diff options
author | Sverker Eriksson <[email protected]> | 2012-07-05 15:58:22 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2012-07-05 15:58:22 +0200 |
commit | 13fb710888b866830b673d019485ad58756fd23f (patch) | |
tree | 0f0545a0910b07ad1158b171cbdcea64c3df5ade /lib | |
parent | 2d519dc7ff781693451f6432e29fe55864bce482 (diff) | |
parent | 4ce6c4d5618ae8cfb39f8c08fb1cf937fc9db09a (diff) | |
download | otp-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.erl | 10 |
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 -> |