From: Florian Forster Date: Sat, 30 Jun 2007 15:01:04 +0000 (+0200) Subject: {hddtemp,mbmon,ntpd} plugins: Only use the `AI_ADDRCONFIG' if it's defined. X-Git-Tag: collectd-4.0.5~5 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=5a8e0d71e65d6d16934401d581f42c0f033bca0f;p=collectd.git {hddtemp,mbmon,ntpd} plugins: Only use the `AI_ADDRCONFIG' if it's defined. --- diff --git a/src/hddtemp.c b/src/hddtemp.c index d60481e3..c7774658 100644 --- a/src/hddtemp.c +++ b/src/hddtemp.c @@ -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; diff --git a/src/mbmon.c b/src/mbmon.c index 68a09850..7694abc5 100644 --- a/src/mbmon.c +++ b/src/mbmon.c @@ -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; diff --git a/src/ntpd.c b/src/ntpd.c index 1c97e69a..23daacdb 100644 --- a/src/ntpd.c +++ b/src/ntpd.c @@ -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;