treewide: stop checking for AI_ADDRCONFIG
[collectd.git] / src / hddtemp.c
index 82c158c..bda41a1 100644 (file)
@@ -35,7 +35,6 @@
 #include "configfile.h"
 
 # include <netdb.h>
-# include <sys/socket.h>
 # include <netinet/in.h>
 # include <netinet/tcp.h>
 # include <libgen.h> /* for basename */
@@ -89,15 +88,11 @@ static int hddtemp_query_daemon (char *buffer, int buffer_size)
        const char *host;
        const char *port;
 
-       struct addrinfo  ai_hints;
+       struct addrinfo  ai_hints = { 0 };
        struct addrinfo *ai_list, *ai_ptr;
        int              ai_return;
 
-       memset (&ai_hints, '\0', sizeof (ai_hints));
-       ai_hints.ai_flags    = 0;
-#ifdef AI_ADDRCONFIG
-       ai_hints.ai_flags   |= AI_ADDRCONFIG;
-#endif
+       ai_hints.ai_flags    = AI_ADDRCONFIG;
        ai_hints.ai_family   = PF_UNSPEC;
        ai_hints.ai_socktype = SOCK_STREAM;
        ai_hints.ai_protocol = IPPROTO_TCP;