X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fstatsd.c;h=8acd9fd21262284e8fe222c3eea3f6b30fbab156;hb=5afde1077e3c8fc119b79caa2572cbf84dbfe5ca;hp=1eb8cb94c59df032f1615909a1341ec63cab432c;hpb=362a519e00d50fc3657d485135075f753ec71bab;p=collectd.git diff --git a/src/statsd.c b/src/statsd.c index 1eb8cb94..8acd9fd2 100644 --- a/src/statsd.c +++ b/src/statsd.c @@ -500,8 +500,7 @@ static int statsd_network_init (struct pollfd **ret_fds, /* {{{ */ struct pollfd *fds = NULL; size_t fds_num = 0; - struct addrinfo ai_hints = { 0 }; - struct addrinfo *ai_list = NULL; + struct addrinfo *ai_list; struct addrinfo *ai_ptr; int status; @@ -509,12 +508,11 @@ static int statsd_network_init (struct pollfd **ret_fds, /* {{{ */ char const *service = (conf_service != NULL) ? conf_service : STATSD_DEFAULT_SERVICE; - ai_hints.ai_flags = AI_PASSIVE; -#ifdef AI_ADDRCONFIG - ai_hints.ai_flags |= AI_ADDRCONFIG; -#endif - ai_hints.ai_family = AF_UNSPEC; - ai_hints.ai_socktype = SOCK_DGRAM; + struct addrinfo ai_hints = { + .ai_family = AF_UNSPEC, + .ai_flags = AI_PASSIVE | AI_ADDRCONFIG, + .ai_socktype = SOCK_DGRAM + }; status = getaddrinfo (node, service, &ai_hints, &ai_list); if (status != 0)