dirmngr: Build fix for FreeBSD (EAI macros)
authorWerner Koch <wk@gnupg.org>
Wed, 27 Jan 2016 12:55:31 +0000 (13:55 +0100)
committerWerner Koch <wk@gnupg.org>
Wed, 27 Jan 2016 13:00:15 +0000 (14:00 +0100)
* dirmngr/dns-stuff.c (map_eai_to_gpg_error): Map EAI_NODATA and
EAI_ADDRFAMILY only if defined.
--

Reported-by: Christoph Moench-Tegeder <cmt@burggraben.net>
Signed-off-by: Werner Koch <wk@gnupg.org>
dirmngr/dns-stuff.c

index 63dfc8d..40c71f3 100644 (file)
@@ -177,13 +177,17 @@ map_eai_to_gpg_error (int ec)
     case EAI_BADFLAGS:  err = gpg_error (GPG_ERR_INV_FLAG); break;
     case EAI_FAIL:      err = gpg_error (GPG_ERR_SERVER_FAILED); break;
     case EAI_MEMORY:    err = gpg_error (GPG_ERR_ENOMEM); break;
+#ifdef EAI_NODATA
     case EAI_NODATA:    err = gpg_error (GPG_ERR_NO_DATA); break;
+#endif
     case EAI_NONAME:    err = gpg_error (GPG_ERR_NO_NAME); break;
     case EAI_SERVICE:   err = gpg_error (GPG_ERR_NOT_SUPPORTED); break;
     case EAI_FAMILY:    err = gpg_error (GPG_ERR_EAFNOSUPPORT); break;
     case EAI_SOCKTYPE:  err = gpg_error (GPG_ERR_ESOCKTNOSUPPORT); break;
 #ifndef HAVE_W32_SYSTEM
+# ifdef EAI_ADDRFAMILY
     case EAI_ADDRFAMILY:err = gpg_error (GPG_ERR_EADDRNOTAVAIL); break;
+# endif
     case EAI_SYSTEM:    err = gpg_error_from_syserror (); break;
 #endif
     default:            err = gpg_error (GPG_ERR_UNKNOWN_ERRNO); break;