Code

{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 d60481e35663313c34b05abd6c4aedabf82f652d..c77746589858cef0941934727d336c9b12ce9514 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 68a0985044acdfeaf672b0107dbd94ae59ac88e9..7694abc5dd04e8e39b9ece4015dfece8d7e62195 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 1c97e69ad721c834c93f41b8e6407a65e6d1f3cb..23daacdb801fc9c10f94d4a0b66dc22d045bc811 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;