treewide: use designated initializers for ai_hints
[collectd.git] / src / statsd.c
index 5df072d..285486d 100644 (file)
@@ -500,7 +500,6 @@ 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_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)