aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded/src/prim_inet.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2012-03-16 11:33:38 +0100
committerBjörn-Egil Dahlberg <[email protected]>2012-03-16 11:33:38 +0100
commit8412801d553f0f5c89243476ab147b3a5c915423 (patch)
tree08ffa932771912f92c3adf6e2cb97d22ac3f4fb4 /erts/preloaded/src/prim_inet.erl
parent949ee23d72e4412fed3059c04e395f995388a5fb (diff)
downloadotp-8412801d553f0f5c89243476ab147b3a5c915423.tar.gz
otp-8412801d553f0f5c89243476ab147b3a5c915423.tar.bz2
otp-8412801d553f0f5c89243476ab147b3a5c915423.zip
prim_inet: Catch system_limit in open_port
Will catch system_limit and return error tuple instead. An uncaught exception would be an incorrect behaviour. This problem would occur for gen_tcp:listen/1,2 for example.
Diffstat (limited to 'erts/preloaded/src/prim_inet.erl')
-rw-r--r--erts/preloaded/src/prim_inet.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/erts/preloaded/src/prim_inet.erl b/erts/preloaded/src/prim_inet.erl
index 0cedd284db..14bf3b6c69 100644
--- a/erts/preloaded/src/prim_inet.erl
+++ b/erts/preloaded/src/prim_inet.erl
@@ -83,8 +83,10 @@ open(Protocol, Family, Type, Req, Data) ->
end
catch
%% The only (?) way to get here is to try to open
- %% the sctp driver when it does not exist
- error:badarg -> {error,eprotonosupport}
+ %% the sctp driver when it does not exist (badarg)
+ error:badarg -> {error, eprotonosupport};
+ %% system_limit if out of port slots
+ error:system_limit -> {error, system_limit}
end.
enc_family(inet) -> ?INET_AF_INET;