{hddtemp,mbmon,ntpd} plugins: Only use the `AI_ADDRCONFIG' if it's defined.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 30 Jun 2007 15:01:04 +0000 (17:01 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 30 Jun 2007 15:01:04 +0000 (17:01 +0200)
src/hddtemp.c
src/mbmon.c
src/ntpd.c

index d60481e..c777465 100644 (file)
@@ -108,7 +108,10 @@ static int hddtemp_query_daemon (char *buffer, int buffer_size)
        int              ai_return;
 
        memset (&ai_hints, '\0', sizeof (ai_hints));
-       ai_hints.ai_flags    = AI_ADDRCONFIG;
+       ai_hints.ai_flags    = 0;
+#ifdef AI_ADDRCONFIG
+       ai_hints.ai_flags   |= AI_ADDRCONFIG;
+#endif
        ai_hints.ai_family   = PF_UNSPEC;
        ai_hints.ai_socktype = SOCK_STREAM;
        ai_hints.ai_protocol = IPPROTO_TCP;
index 68a0985..7694abc 100644 (file)
@@ -94,7 +94,10 @@ static int mbmon_query_daemon (char *buffer, int buffer_size)
        int              ai_return;
 
        memset (&ai_hints, '\0', sizeof (ai_hints));
-       ai_hints.ai_flags    = AI_ADDRCONFIG;
+       ai_hints.ai_flags    = 0;
+#ifdef AI_ADDRCONFIG
+       ai_hints.ai_flags   |= AI_ADDRCONFIG;
+#endif
        ai_hints.ai_family   = PF_UNSPEC;
        ai_hints.ai_socktype = SOCK_STREAM;
        ai_hints.ai_protocol = IPPROTO_TCP;
index 1c97e69..23daacd 100644 (file)
@@ -355,7 +355,10 @@ static int ntpd_connect (void)
                port = NTPD_DEFAULT_PORT;
 
        memset (&ai_hints, '\0', sizeof (ai_hints));
-       ai_hints.ai_flags    = AI_ADDRCONFIG;
+       ai_hints.ai_flags    = 0;
+#ifdef AI_ADDRCONFIG
+       ai_hints.ai_flags   |= AI_ADDRCONFIG;
+#endif
        ai_hints.ai_family   = PF_UNSPEC;
        ai_hints.ai_socktype = SOCK_DGRAM;
        ai_hints.ai_protocol = IPPROTO_UDP;