aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2011-09-28 11:48:08 +0200
committerRaimo Niskanen <[email protected]>2011-11-17 15:42:14 +0100
commit4f8e3e94357cd4730c9e3135f2bafd9b6d4fd13e (patch)
tree408113a7211e7ca3a126af1dea09450475a550ca /erts/preloaded
parent3be53d45e394dab127563d7a8d6da109cd9bc108 (diff)
downloadotp-4f8e3e94357cd4730c9e3135f2bafd9b6d4fd13e.tar.gz
otp-4f8e3e94357cd4730c9e3135f2bafd9b6d4fd13e.tar.bz2
otp-4f8e3e94357cd4730c9e3135f2bafd9b6d4fd13e.zip
erts,kernel: Return eprotonosupport when SCTP is not supported
It is better that gen_sctp:open/0-2 returns the informative Posix return code {error,eprotonosupport} than previously {error,badarg} when SCTP is not supported since it is so platform dependent.
Diffstat (limited to 'erts/preloaded')
-rw-r--r--erts/preloaded/src/prim_inet.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/erts/preloaded/src/prim_inet.erl b/erts/preloaded/src/prim_inet.erl
index 30c1bec292..f144f73d68 100644
--- a/erts/preloaded/src/prim_inet.erl
+++ b/erts/preloaded/src/prim_inet.erl
@@ -81,7 +81,9 @@ open(Protocol, Family, Type, Req, Data) ->
Error
end
catch
- error:Reason -> {error,Reason}
+ %% The only (?) way to get here is to try to open
+ %% the sctp driver when it does not exist
+ error:badarg -> {error,eprotonosupport}
end.
enc_family(inet) -> ?INET_AF_INET;