aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2019-04-23 12:14:08 +0200
committerLukas Larsson <[email protected]>2019-04-23 13:49:21 +0200
commit4ffb28fa775daf7e157031654bcf7712cce6d0f1 (patch)
tree56840155a339aad7d29dc5bd8040d30710973930 /lib/kernel/src
parentd0d4f2be1ebfe8293a627531b65819e85482c1d9 (diff)
downloadotp-4ffb28fa775daf7e157031654bcf7712cce6d0f1.tar.gz
otp-4ffb28fa775daf7e157031654bcf7712cce6d0f1.tar.bz2
otp-4ffb28fa775daf7e157031654bcf7712cce6d0f1.zip
kernel: Multiple -sname or -name would be ignored
If 'erl -sname 1 -sname 2' is run the node is not started in distribution mode at all. This fix makes the last sname be used.
Diffstat (limited to 'lib/kernel/src')
-rw-r--r--lib/kernel/src/erl_distribution.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/kernel/src/erl_distribution.erl b/lib/kernel/src/erl_distribution.erl
index 0bec78e938..cdb2d2f1f6 100644
--- a/lib/kernel/src/erl_distribution.erl
+++ b/lib/kernel/src/erl_distribution.erl
@@ -21,6 +21,8 @@
-behaviour(supervisor).
+-include_lib("kernel/include/logger.hrl").
+
-export([start_link/0,start_link/2,init/1,start/1,stop/0]).
-define(DBG,erlang:display([?MODULE,?LINE])).
@@ -83,6 +85,10 @@ do_start_link([{Arg,Flag}|T]) ->
case init:get_argument(Arg) of
{ok,[[Name]]} ->
start_link([list_to_atom(Name),Flag|ticktime()], true);
+ {ok,[[Name]|_Rest]} ->
+ ?LOG_WARNING("Multiple -~p given to erl, using the first, ~p",
+ [Arg, Name]),
+ start_link([list_to_atom(Name),Flag|ticktime()], true);
_ ->
do_start_link(T)
end;