diff options
author | Lukas Larsson <[email protected]> | 2019-04-23 12:14:08 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2019-04-23 13:49:21 +0200 |
commit | 4ffb28fa775daf7e157031654bcf7712cce6d0f1 (patch) | |
tree | 56840155a339aad7d29dc5bd8040d30710973930 /lib/kernel/src | |
parent | d0d4f2be1ebfe8293a627531b65819e85482c1d9 (diff) | |
download | otp-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.erl | 6 |
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; |