concat
This commit is contained in:
parent
5daeac083c
commit
6a66ca90b1
|
@ -27,6 +27,8 @@
|
||||||
|
|
||||||
-module(emqttd_dist).
|
-module(emqttd_dist).
|
||||||
|
|
||||||
|
-import(lists, [concat/1]).
|
||||||
|
|
||||||
-export([parse_node/1]).
|
-export([parse_node/1]).
|
||||||
|
|
||||||
parse_node(Name) when is_list(Name) ->
|
parse_node(Name) when is_list(Name) ->
|
||||||
|
@ -40,10 +42,10 @@ parse_node(Name) when is_list(Name) ->
|
||||||
with_domain(Name) ->
|
with_domain(Name) ->
|
||||||
case net_kernel:longnames() of
|
case net_kernel:longnames() of
|
||||||
true ->
|
true ->
|
||||||
Name ++ "@" ++ inet_db:gethostname() ++
|
concat([Name, "@", inet_db:gethostname(),
|
||||||
"." ++ inet_db:res_option(domain);
|
".", inet_db:res_option(domain)]);
|
||||||
false ->
|
false ->
|
||||||
Name ++ "@" ++ inet_db:gethostname();
|
concat([Name, "@", inet_db:gethostname()]);
|
||||||
_ ->
|
_ ->
|
||||||
Name
|
Name
|
||||||
end.
|
end.
|
||||||
|
|
Loading…
Reference in New Issue