diff options
author | Marcus Arendt <[email protected]> | 2014-08-21 10:40:59 +0200 |
---|---|---|
committer | Marcus Arendt <[email protected]> | 2014-08-21 10:40:59 +0200 |
commit | bbb5d7cf533b1bf12b96aa7ea1a53dc286e64d43 (patch) | |
tree | d489a43ffacacfbb6c7dc6a15aa96c1fdabe512e /lib/kernel/src/erl_epmd.erl | |
parent | 05d8ce4d317df08076433296449083e9848b4d2d (diff) | |
parent | 4e688cf875e993ca27d29771ad31558934af99c7 (diff) | |
download | otp-bbb5d7cf533b1bf12b96aa7ea1a53dc286e64d43.tar.gz otp-bbb5d7cf533b1bf12b96aa7ea1a53dc286e64d43.tar.bz2 otp-bbb5d7cf533b1bf12b96aa7ea1a53dc286e64d43.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/kernel/src/erl_epmd.erl')
-rw-r--r-- | lib/kernel/src/erl_epmd.erl | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/kernel/src/erl_epmd.erl b/lib/kernel/src/erl_epmd.erl index b4fae24ef3..f6e2ca0954 100644 --- a/lib/kernel/src/erl_epmd.erl +++ b/lib/kernel/src/erl_epmd.erl @@ -85,24 +85,19 @@ port_please1(Node,HostName, Timeout) -> Else end. -names() -> +names() -> {ok, H} = inet:gethostname(), names(H). -names(HostName) when is_atom(HostName) -> - names1(atom_to_list(HostName)); -names(HostName) when is_list(HostName) -> - names1(HostName); -names(EpmdAddr) -> - get_names(EpmdAddr). - -names1(HostName) -> +names(HostName) when is_atom(HostName); is_list(HostName) -> case inet:gethostbyname(HostName) of {ok,{hostent, _Name, _ , _Af, _Size, [EpmdAddr | _]}} -> get_names(EpmdAddr); Else -> Else - end. + end; +names(EpmdAddr) -> + get_names(EpmdAddr). register_node(Name, PortNo) -> |