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.

34 lines
1.0 KiB

  1. From ec73e05867d8e80b1f5d056f35eea8f9011b8c3c Mon Sep 17 00:00:00 2001
  2. From: Brent Cook <busterb@gmail.com>
  3. Date: Tue, 30 Dec 2014 09:04:08 -0600
  4. Subject: [PATCH 06/14] EAI_NODATA does not exist everywhere
  5. FreeBSD says it is deprecated and should be removed.
  6. ---
  7. src/usr.sbin/ntpd/config.c | 10 ++++++++--
  8. 1 file changed, 8 insertions(+), 2 deletions(-)
  9. diff --git a/src/usr.sbin/ntpd/config.c b/src/usr.sbin/ntpd/config.c
  10. index b651c62..d571dd7 100644
  11. --- a/src/usr.sbin/ntpd/config.c
  12. +++ b/src/usr.sbin/ntpd/config.c
  13. @@ -128,8 +128,14 @@ host_dns(const char *s, struct ntp_addr **hn)
  14. hints.ai_family = PF_UNSPEC;
  15. hints.ai_socktype = SOCK_DGRAM; /* DUMMY */
  16. error = getaddrinfo(s, NULL, &hints, &res0);
  17. - if (error == EAI_AGAIN || error == EAI_NODATA || error == EAI_NONAME)
  18. - return (0);
  19. + switch (error) {
  20. + case EAI_AGAIN:
  21. + case EAI_NONAME:
  22. +#ifdef EAI_NODATA
  23. + case EAI_NODATA:
  24. +#endif
  25. + return (0);
  26. + }
  27. if (error) {
  28. log_warnx("could not parse \"%s\": %s", s,
  29. gai_strerror(error));
  30. --
  31. 1.9.1