diff options
author | Siri Hansen <[email protected]> | 2013-04-25 16:14:10 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2013-05-06 12:14:13 +0200 |
commit | f52452309cf68da898a1768eb6e8b6767e602bc7 (patch) | |
tree | c24a32ecedfd7f4baaa3c8f4e9e474a7dbef738b /lib/kernel/src/inet_res.erl | |
parent | 88eea0e9a22099a1425553381cfb72f646cb2abf (diff) | |
download | otp-f52452309cf68da898a1768eb6e8b6767e602bc7.tar.gz otp-f52452309cf68da898a1768eb6e8b6767e602bc7.tar.bz2 otp-f52452309cf68da898a1768eb6e8b6767e602bc7.zip |
Fix unmatched_return warnings in kernel
Diffstat (limited to 'lib/kernel/src/inet_res.erl')
-rw-r--r-- | lib/kernel/src/inet_res.erl | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/lib/kernel/src/inet_res.erl b/lib/kernel/src/inet_res.erl index 1a30979126..ab9cbf0617 100644 --- a/lib/kernel/src/inet_res.erl +++ b/lib/kernel/src/inet_res.erl @@ -921,18 +921,25 @@ query_tcp(Timeout, Id, Buffer, IP, Port, Verbose) -> [{active,false},{packet,2},binary,Family], Timeout) of {ok, S} -> - gen_tcp:send(S, Buffer), - case gen_tcp:recv(S, 0, Timeout) of - {ok, Answer} -> - gen_tcp:close(S), - case decode_answer(Answer, Id, Verbose) of - {ok, _} = OK -> OK; - {error, badid} -> {error, servfail}; - Error -> Error + case gen_tcp:send(S, Buffer) of + ok -> + case gen_tcp:recv(S, 0, Timeout) of + {ok, Answer} -> + gen_tcp:close(S), + case decode_answer(Answer, Id, Verbose) of + {ok, _} = OK -> OK; + {error, badid} -> {error, servfail}; + Error -> Error + end; + Error -> + gen_tcp:close(S), + ?verbose(Verbose, "TCP server recv error: ~p\n", + [Error]), + Error end; Error -> gen_tcp:close(S), - ?verbose(Verbose, "TCP server recv error: ~p\n", + ?verbose(Verbose, "TCP server send error: ~p\n", [Error]), Error end; |