aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--erts/preloaded/src/prim_inet.erl4
-rw-r--r--lib/kernel/test/gen_sctp_SUITE.erl11
2 files changed, 6 insertions, 9 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;
diff --git a/lib/kernel/test/gen_sctp_SUITE.erl b/lib/kernel/test/gen_sctp_SUITE.erl
index 301f69ce09..d0b0bdf4d4 100644
--- a/lib/kernel/test/gen_sctp_SUITE.erl
+++ b/lib/kernel/test/gen_sctp_SUITE.erl
@@ -44,17 +44,12 @@ groups() ->
[].
init_per_suite(Config) ->
- try gen_sctp:open() of
+ case gen_sctp:open() of
{ok,Socket} ->
gen_sctp:close(Socket),
[];
- _ ->
- []
- catch
- error:badarg ->
- {skip,"SCTP not supported on this machine"};
- _:_ ->
- Config
+ {error,eprotonosupport} ->
+ {skip,"SCTP not supported on this machine"}
end.
end_per_suite(_Conifig) ->