diff options
author | Marcus Arendt <[email protected]> | 2014-08-21 10:40:16 +0200 |
---|---|---|
committer | Marcus Arendt <[email protected]> | 2014-08-21 10:40:16 +0200 |
commit | 4e688cf875e993ca27d29771ad31558934af99c7 (patch) | |
tree | b88effd48a556a70e468a1b07eccb89d67d80b64 /lib/kernel/src/erl_epmd.erl | |
parent | 305bfc3360acfae8af75b36e00c61298b6ea582e (diff) | |
parent | fcef4dd4614211ca5cc592c428655cbad0342fa2 (diff) | |
download | otp-4e688cf875e993ca27d29771ad31558934af99c7.tar.gz otp-4e688cf875e993ca27d29771ad31558934af99c7.tar.bz2 otp-4e688cf875e993ca27d29771ad31558934af99c7.zip |
Merge branch 'lucafavatella/accept-ip-in-net_adm-names' into maint
* lucafavatella/accept-ip-in-net_adm-names:
Refactor erl_epmd:names/1
Accept inet:ip_address() in net_adm:names/1
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) -> |