From 5a8e0d71e65d6d16934401d581f42c0f033bca0f Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 30 Jun 2007 17:01:04 +0200 Subject: [PATCH] {hddtemp,mbmon,ntpd} plugins: Only use the `AI_ADDRCONFIG' if it's defined. --- src/hddtemp.c | 5 ++++- src/mbmon.c | 5 ++++- src/ntpd.c | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) 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; -- 2.30.2