Portable build framework for OpenNTPD
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

40 lines
1.2 KiB

From e6b57234f53bfe3de18082dc2d374e14c189d37a Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Tue, 30 Dec 2014 09:04:08 -0600
Subject: [PATCH 02/13] EAI_NODATA does not exist everywhere
FreeBSD says it is deprecated #ifdef's it out.
Linux glibc hides it and many other return codes behind __USE_GNU.
What is that supposed to mean?
It seems the only effect of 'deprecating' this value has been that all
portable software now has to have a special check instead.
---
src/usr.sbin/ntpd/config.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/usr.sbin/ntpd/config.c b/src/usr.sbin/ntpd/config.c
index fcf89ddfc..e3eeed3d6 100644
--- a/src/usr.sbin/ntpd/config.c
+++ b/src/usr.sbin/ntpd/config.c
@@ -133,8 +133,14 @@ host_dns(const char *s, struct ntp_addr **hn)
hints.ai_socktype = SOCK_DGRAM; /* DUMMY */
/* ntpd MUST NOT use AI_ADDRCONFIG here */
error = getaddrinfo(s, NULL, &hints, &res0);
- if (error == EAI_AGAIN || error == EAI_NODATA || error == EAI_NONAME)
- return (0);
+ switch (error) {
+ case EAI_AGAIN:
+ case EAI_NONAME:
+#ifdef EAI_NODATA
+ case EAI_NODATA:
+#endif
+ return (0);
+ }
if (error) {
log_warnx("could not parse \"%s\": %s", s,
gai_strerror(error));
--
2.13.0