aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/inet_gethost_native.erl
diff options
context:
space:
mode:
authorKostis Sagonas <[email protected]>2010-03-07 11:05:06 +0100
committerBjörn Gustavsson <[email protected]>2010-04-28 07:04:56 +0200
commit75ea6a39d1cf4bd4a67391595b90d8d90155d012 (patch)
tree7641cd91bbe2a28399280d691fe3904e0cf26913 /lib/kernel/src/inet_gethost_native.erl
parent39e5ca57147c08502806f873c107c77e197a78ab (diff)
downloadotp-75ea6a39d1cf4bd4a67391595b90d8d90155d012.tar.gz
otp-75ea6a39d1cf4bd4a67391595b90d8d90155d012.tar.bz2
otp-75ea6a39d1cf4bd4a67391595b90d8d90155d012.zip
kernel: Clean up as suggested by tidier
Diffstat (limited to 'lib/kernel/src/inet_gethost_native.erl')
-rw-r--r--lib/kernel/src/inet_gethost_native.erl15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/kernel/src/inet_gethost_native.erl b/lib/kernel/src/inet_gethost_native.erl
index b7b3007b99..db3e44ce6f 100644
--- a/lib/kernel/src/inet_gethost_native.erl
+++ b/lib/kernel/src/inet_gethost_native.erl
@@ -154,7 +154,7 @@ run_once() ->
{Port, {data, <<1:32, BinReply/binary>>}} ->
Pid ! {R, {ok, BinReply}}
after Timeout ->
- Pid ! {R,{error,timeout}}
+ Pid ! {R, {error, timeout}}
end.
-spec terminate(term(), pid()) -> 'ok'.
@@ -342,14 +342,14 @@ pick_client(State,RID,Clid) ->
{last, SoleClient}; % Note, not removed, the caller
% should cleanup request data
CList ->
- case lists:keysearch(Clid,1,CList) of
- {value, Client} ->
+ case lists:keyfind(Clid,1,CList) of
+ false ->
+ false;
+ Client ->
NCList = lists:keydelete(Clid,1,CList),
ets:insert(State#state.requests,
R#request{clients = NCList}),
- {more, Client};
- false ->
- false
+ {more, Client}
end
end
end.
@@ -387,8 +387,7 @@ restart_port(#state{port = Port, requests = Requests}) ->
end,
Requests),
NewPort.
-
-
+
do_open_port(Poolsize, ExtraArgs) ->
try