diff options
author | Sverker Eriksson <[email protected]> | 2011-03-03 12:47:02 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2011-03-03 12:47:02 +0100 |
commit | 45892fd845b74532a6cae750372b6e80eb8e3ad9 (patch) | |
tree | 2c27332986f6803a6ef97072b0e8e70265b1fa59 /lib | |
parent | e38a935df26ca0f37fa17c6df771430de18f9043 (diff) | |
parent | be3218dc1bf7dec1217bcac82492a5550da7ee17 (diff) | |
download | otp-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')
-rw-r--r-- | lib/kernel/src/net_kernel.erl | 31 | ||||
-rw-r--r-- | lib/kernel/src/os.erl | 24 |
2 files changed, 26 insertions, 29 deletions
diff --git a/lib/kernel/src/net_kernel.erl b/lib/kernel/src/net_kernel.erl index f5e2820bbe..23db85e1f4 100644 --- a/lib/kernel/src/net_kernel.erl +++ b/lib/kernel/src/net_kernel.erl @@ -322,24 +322,19 @@ init({Name, LongOrShortNames, TickT}) -> process_flag(priority, max), Ticktime = to_integer(TickT), Ticker = spawn_link(net_kernel, ticker, [self(), Ticktime]), - case auth:get_cookie(Node) of - Cookie when is_atom(Cookie) -> - {ok, #state{name = Name, - node = Node, - type = LongOrShortNames, - tick = #tick{ticker = Ticker, time = Ticktime}, - connecttime = connecttime(), - connections = - ets:new(sys_dist,[named_table, - protected, - {keypos, 2}]), - listen = Listeners, - allowed = [], - verbose = 0 - }}; - _ELSE -> - {stop, {error,{bad_cookie, Node}}} - end; + {ok, #state{name = Name, + node = Node, + type = LongOrShortNames, + tick = #tick{ticker = Ticker, time = Ticktime}, + connecttime = connecttime(), + connections = + ets:new(sys_dist,[named_table, + protected, + {keypos, 2}]), + listen = Listeners, + allowed = [], + verbose = 0 + }}; Error -> {stop, Error} end. 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 |