|
From ec73e05867d8e80b1f5d056f35eea8f9011b8c3c Mon Sep 17 00:00:00 2001
|
|
From: Brent Cook <busterb@gmail.com>
|
|
Date: Tue, 30 Dec 2014 09:04:08 -0600
|
|
Subject: [PATCH 06/14] EAI_NODATA does not exist everywhere
|
|
|
|
FreeBSD says it is deprecated and should be removed.
|
|
---
|
|
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 b651c62..d571dd7 100644
|
|
--- a/src/usr.sbin/ntpd/config.c
|
|
+++ b/src/usr.sbin/ntpd/config.c
|
|
@@ -128,8 +128,14 @@ host_dns(const char *s, struct ntp_addr **hn)
|
|
hints.ai_family = PF_UNSPEC;
|
|
hints.ai_socktype = SOCK_DGRAM; /* DUMMY */
|
|
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));
|
|
--
|
|
1.9.1
|
|
|