X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fstatsd.c;h=8acd9fd21262284e8fe222c3eea3f6b30fbab156;hb=71bbf854d3e6f8c6d6c3582527263bb01a3a7e04;hp=5df072d3f3e2bd939b5bec3577660a363c3dbda8;hpb=c5960550f1b05c46cc7859270a0ed819a8b5fd40;p=collectd.git diff --git a/src/statsd.c b/src/statsd.c index 5df072d3..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,9 +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 | AI_ADDRCONFIG; - 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)