aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/os.erl
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2011-03-03 12:47:02 +0100
committerSverker Eriksson <[email protected]>2011-03-03 12:47:02 +0100
commit45892fd845b74532a6cae750372b6e80eb8e3ad9 (patch)
tree2c27332986f6803a6ef97072b0e8e70265b1fa59 /lib/kernel/src/os.erl
parente38a935df26ca0f37fa17c6df771430de18f9043 (diff)
parentbe3218dc1bf7dec1217bcac82492a5550da7ee17 (diff)
downloadotp-45892fd845b74532a6cae750372b6e80eb8e3ad9.tar.gz
otp-45892fd845b74532a6cae750372b6e80eb8e3ad9.tar.bz2
otp-45892fd845b74532a6cae750372b6e80eb8e3ad9.zip
Merge branch 'sverker/dialyzer_kernel_fixes' into dev
* sverker/dialyzer_kernel_fixes: Fix dialyzer warning in os:start_port_srv_loop Update preloaded modules Fix three dialyzer warnings in kernel
Diffstat (limited to 'lib/kernel/src/os.erl')
-rw-r--r--lib/kernel/src/os.erl24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/kernel/src/os.erl b/lib/kernel/src/os.erl
index ce8c581e08..95a2f71ec0 100644
--- a/lib/kernel/src/os.erl
+++ b/lib/kernel/src/os.erl
@@ -231,9 +231,13 @@ start_port_srv(Request) ->
catch
error:_ -> false
end,
- start_port_srv_loop(Request, StayAlive).
+ start_port_srv_handle(Request),
+ case StayAlive of
+ true -> start_port_srv_loop();
+ false -> exiting
+ end.
-start_port_srv_loop({Ref,Client}, StayAlive) ->
+start_port_srv_handle({Ref,Client}) ->
Reply = try open_port({spawn, ?SHELL},[stream]) of
Port when is_port(Port) ->
(catch port_connect(Port, Client)),
@@ -243,20 +247,18 @@ start_port_srv_loop({Ref,Client}, StayAlive) ->
error:Reason ->
{Reason,erlang:get_stacktrace()}
end,
- Client ! {Ref,Reply},
- case StayAlive of
- true -> start_port_srv_loop(get_open_port_request(), true);
- false -> exiting
- end.
+ Client ! {Ref,Reply}.
-get_open_port_request() ->
+
+start_port_srv_loop() ->
receive
{Ref, Client} = Request when is_reference(Ref),
is_pid(Client) ->
- Request;
+ start_port_srv_handle(Request);
_Junk ->
- get_open_port_request()
- end.
+ ignore
+ end,
+ start_port_srv_loop().
%%
%% unix_get_data(Port) -> Result