diff options
-rw-r--r-- | erts/preloaded/ebin/erl_prim_loader.beam | bin | 50384 -> 50384 bytes | |||
-rw-r--r-- | erts/preloaded/ebin/erlang.beam | bin | 24320 -> 24144 bytes | |||
-rw-r--r-- | erts/preloaded/ebin/init.beam | bin | 44876 -> 44876 bytes | |||
-rw-r--r-- | erts/preloaded/ebin/otp_ring0.beam | bin | 1432 -> 1432 bytes | |||
-rw-r--r-- | erts/preloaded/ebin/prim_file.beam | bin | 31552 -> 31548 bytes | |||
-rw-r--r-- | erts/preloaded/ebin/prim_inet.beam | bin | 65060 -> 64888 bytes | |||
-rw-r--r-- | erts/preloaded/ebin/prim_zip.beam | bin | 22432 -> 22432 bytes | |||
-rw-r--r-- | erts/preloaded/ebin/zlib.beam | bin | 10616 -> 10616 bytes | |||
-rw-r--r-- | erts/preloaded/src/erlang.erl | 16 | ||||
-rw-r--r-- | erts/preloaded/src/prim_inet.erl | 4 | ||||
-rw-r--r-- | lib/kernel/src/net_kernel.erl | 31 | ||||
-rw-r--r-- | lib/kernel/src/os.erl | 24 |
12 files changed, 33 insertions, 42 deletions
diff --git a/erts/preloaded/ebin/erl_prim_loader.beam b/erts/preloaded/ebin/erl_prim_loader.beam Binary files differindex 87ff5119fd..bff3f7f9de 100644 --- a/erts/preloaded/ebin/erl_prim_loader.beam +++ b/erts/preloaded/ebin/erl_prim_loader.beam diff --git a/erts/preloaded/ebin/erlang.beam b/erts/preloaded/ebin/erlang.beam Binary files differindex 6b0d96ff8e..5d2f187435 100644 --- a/erts/preloaded/ebin/erlang.beam +++ b/erts/preloaded/ebin/erlang.beam diff --git a/erts/preloaded/ebin/init.beam b/erts/preloaded/ebin/init.beam Binary files differindex 8a7a9a1314..7e492057da 100644 --- a/erts/preloaded/ebin/init.beam +++ b/erts/preloaded/ebin/init.beam diff --git a/erts/preloaded/ebin/otp_ring0.beam b/erts/preloaded/ebin/otp_ring0.beam Binary files differindex 5d544ff4aa..c443866671 100644 --- a/erts/preloaded/ebin/otp_ring0.beam +++ b/erts/preloaded/ebin/otp_ring0.beam diff --git a/erts/preloaded/ebin/prim_file.beam b/erts/preloaded/ebin/prim_file.beam Binary files differindex 3ed02ecd44..4a75e43e73 100644 --- a/erts/preloaded/ebin/prim_file.beam +++ b/erts/preloaded/ebin/prim_file.beam diff --git a/erts/preloaded/ebin/prim_inet.beam b/erts/preloaded/ebin/prim_inet.beam Binary files differindex 79a8d22366..30bbfb0943 100644 --- a/erts/preloaded/ebin/prim_inet.beam +++ b/erts/preloaded/ebin/prim_inet.beam diff --git a/erts/preloaded/ebin/prim_zip.beam b/erts/preloaded/ebin/prim_zip.beam Binary files differindex 3cc8c6b8be..6681466767 100644 --- a/erts/preloaded/ebin/prim_zip.beam +++ b/erts/preloaded/ebin/prim_zip.beam diff --git a/erts/preloaded/ebin/zlib.beam b/erts/preloaded/ebin/zlib.beam Binary files differindex 3f9e867542..593bb8dbed 100644 --- a/erts/preloaded/ebin/zlib.beam +++ b/erts/preloaded/ebin/zlib.beam diff --git a/erts/preloaded/src/erlang.erl b/erts/preloaded/src/erlang.erl index 935c2de253..d6dc070436 100644 --- a/erts/preloaded/src/erlang.erl +++ b/erts/preloaded/src/erlang.erl @@ -427,17 +427,11 @@ delay_trap(Result, Timeout) -> receive after Timeout -> Result end. %% have to reflect that, which we cannot forsee. %% set_cookie(Node, C) when Node =/= nonode@nohost, is_atom(Node) -> - Res = case C of - _ when is_atom(C) -> - auth:set_cookie(Node, C); - {CI,CO} when is_atom(CI), is_atom(CO) -> - auth:set_cookie(Node, {CI, CO}); - _ -> - error - end, - case Res of - error -> exit(badarg); - Other -> Other + case is_atom(C) of + true -> + auth:set_cookie(Node, C); + false -> + error(badarg) end. -spec get_cookie() -> atom(). diff --git a/erts/preloaded/src/prim_inet.erl b/erts/preloaded/src/prim_inet.erl index 446656e45f..2e4a2866e6 100644 --- a/erts/preloaded/src/prim_inet.erl +++ b/erts/preloaded/src/prim_inet.erl @@ -1518,7 +1518,7 @@ enc_value_2(addr, {IP,Port}) when tuple_size(IP) =:= 4 -> [?INET_AF_INET,?int16(Port)|ip4_to_bytes(IP)]; enc_value_2(addr, {IP,Port}) when tuple_size(IP) =:= 8 -> [?INET_AF_INET6,?int16(Port)|ip6_to_bytes(IP)]; -enc_value_2(ether, [X1,X2,X3,X4,X5,X6]) -> [X1,X2,X3,X4,X5,X6]; +enc_value_2(ether, [_,_,_,_,_,_]=Xs) -> Xs; enc_value_2(sockaddr, any) -> [?INET_AF_ANY]; enc_value_2(sockaddr, loopback) -> @@ -1572,7 +1572,7 @@ dec_value(time, [X3,X2,X1,X0|T]) -> Val -> {Val, T} end; dec_value(ip, [A,B,C,D|T]) -> {{A,B,C,D}, T}; -dec_value(ether,[X1,X2,X3,X4,X5,X6|T]) -> {[X1,X2,X3,X4,X5,X6],T}; +%% dec_value(ether, [X1,X2,X3,X4,X5,X6|T]) -> {[X1,X2,X3,X4,X5,X6],T}; dec_value(sockaddr, [X|T]) -> get_ip(X, T); dec_value(linkaddr, [X1,X0|T]) -> 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 |