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

7 years ago
7 years ago
9 years ago
9 years ago
7 years ago
  1. From 25747c0ef42f61f122d73c9c8f7b1d6facd5c437 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 02/13] EAI_NODATA does not exist everywhere
  5. FreeBSD says it is deprecated #ifdef's it out.
  6. Linux glibc hides it and many other return codes behind __USE_GNU.
  7. What is that supposed to mean?
  8. It seems the only effect of 'deprecating' this value has been that all
  9. portable software now has to have a special check instead.
  10. ---
  11. src/usr.sbin/ntpd/config.c | 10 ++++++++--
  12. 1 file changed, 8 insertions(+), 2 deletions(-)
  13. diff --git a/src/usr.sbin/ntpd/config.c b/src/usr.sbin/ntpd/config.c
  14. index fcf89ddfc..e3eeed3d6 100644
  15. --- a/src/usr.sbin/ntpd/config.c
  16. +++ b/src/usr.sbin/ntpd/config.c
  17. @@ -133,8 +133,14 @@ host_dns(const char *s, struct ntp_addr **hn)
  18. hints.ai_socktype = SOCK_DGRAM; /* DUMMY */
  19. /* ntpd MUST NOT use AI_ADDRCONFIG here */
  20. error = getaddrinfo(s, NULL, &hints, &res0);
  21. - if (error == EAI_AGAIN || error == EAI_NODATA || error == EAI_NONAME)
  22. - return (0);
  23. + switch (error) {
  24. + case EAI_AGAIN:
  25. + case EAI_NONAME:
  26. +#ifdef EAI_NODATA
  27. + case EAI_NODATA:
  28. +#endif
  29. + return (0);
  30. + }
  31. if (error) {
  32. log_warnx("could not parse \"%s\": %s", s,
  33. gai_strerror(error));
  34. --
  35. 2.13.0