Permalink
Browse files

collectd_sup:add_server/3: use inet:getaddr/2 when expecting one address

  • Loading branch information...
1 parent c5fec4c commit e623a2f945c3344a05766b13cb52e7f7190a28b5 @astro committed Aug 11, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/collectd_sup.erl
View
4 src/collectd_sup.erl
@@ -17,9 +17,9 @@ start_link() ->
supervisor:start_link({local, ?SERVER}, ?MODULE, []).
add_server(Interval, Host, Port) when is_list(Host) ->
- case inet:getaddrs(Host, inet6) of
+ case inet:getaddr(Host, inet6) of
{ok, Addr} -> add_server(Interval, Addr, Port);
- {error, _} -> case inet:getaddrs(Host, inet) of
+ {error, _} -> case inet:getaddr(Host, inet) of
{ok, Addr} -> add_server(Interval, Addr, Port);
{error, Reason} -> {error, Reason}
end

0 comments on commit e623a2f

Please sign in to comment.