diff options
author | Henrik Nord <[email protected]> | 2015-06-02 14:38:52 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2015-06-02 14:41:45 +0200 |
commit | 00872fbaa648c47f49adf221656b186810ccfc9d (patch) | |
tree | 7514de0f92d502b943317f6fc94966eea2136908 /lib/kernel/src/inet_sctp.erl | |
parent | 2d4367f3c863e71006aed3e0076cf3cd08ca2b42 (diff) | |
parent | c1780b76cdfefbb52025afcf27f6eab01a464e90 (diff) | |
download | otp-00872fbaa648c47f49adf221656b186810ccfc9d.tar.gz otp-00872fbaa648c47f49adf221656b186810ccfc9d.tar.bz2 otp-00872fbaa648c47f49adf221656b186810ccfc9d.zip |
Merge branch 'weiss/propagate-setopt-error'
* weiss/propagate-setopt-error:
Don't throw exception on prim_inet:setopt/3 error
OTP-12798
Diffstat (limited to 'lib/kernel/src/inet_sctp.erl')
-rw-r--r-- | lib/kernel/src/inet_sctp.erl | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/kernel/src/inet_sctp.erl b/lib/kernel/src/inet_sctp.erl index 93528d305d..f0f13c8d4a 100644 --- a/lib/kernel/src/inet_sctp.erl +++ b/lib/kernel/src/inet_sctp.erl @@ -133,15 +133,18 @@ connect_get_assoc(S, Addr, Port, Active, Timer) -> Timeout = inet:timeout(Timer), receive {sctp,S,Addr,Port,{_,#sctp_assoc_change{state=St}=Ev}} -> - case Active of - once -> - ok = prim_inet:setopt(S, active, once); - _ -> ok - end, - if St =:= comm_up -> + SetOptRes = + case Active of + once -> prim_inet:setopt(S, active, once); + _ -> ok + end, + case {St, SetOptRes} of + {comm_up, ok} -> {ok,Ev}; - true -> - {error,Ev} + {_, ok} -> + {error,Ev}; + {_, Error} -> + Error end after Timeout -> {error,timeout} |