aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/dns-stuff.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-10-26 14:53:31 +0000
committerWerner Koch <[email protected]>2015-10-26 15:34:19 +0000
commit7735bbe539af35ce16e270946d5ae798c5989d6e (patch)
treef2c420872907378b299371ae16786027e043d73c /dirmngr/dns-stuff.c
parentgpg: Make sure we only have a single SQL statement. (diff)
downloadgnupg-7735bbe539af35ce16e270946d5ae798c5989d6e.tar.gz
gnupg-7735bbe539af35ce16e270946d5ae798c5989d6e.zip
dirmngr,w32: Remove gethostbyname hack and make it build again.
* dirmngr/http.c (connect_server) [W32]: Remove gethostbyname hack; we require getaddrinfo anyway. * dirmngr/dns-stuff.c (AI_ADDRCONFIG): Add replacement if not defined. (map_eai_to_gpg_error) [W32]: Take care of unsupported codes. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'dirmngr/dns-stuff.c')
-rw-r--r--dirmngr/dns-stuff.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/dirmngr/dns-stuff.c b/dirmngr/dns-stuff.c
index f3b622de3..c80ee1dfa 100644
--- a/dirmngr/dns-stuff.c
+++ b/dirmngr/dns-stuff.c
@@ -59,6 +59,11 @@
# error AF_UNSPEC does not have the value 0
#endif
+/* Windows does not support tge AI_ADDRCONFIG flag - use zero instead. */
+#ifndef AI_ADDRCONFIG
+# define AI_ADDRCONFIG 0
+#endif
+
/* Not every installation has gotten around to supporting SRVs or
CERTs yet... */
#ifndef T_SRV
@@ -115,10 +120,12 @@ map_eai_to_gpg_error (int ec)
case EAI_NODATA: err = gpg_error (GPG_ERR_NO_DATA); break;
case EAI_NONAME: err = gpg_error (GPG_ERR_NO_NAME); break;
case EAI_SERVICE: err = gpg_error (GPG_ERR_NOT_SUPPORTED); break;
- case EAI_ADDRFAMILY:err = gpg_error (GPG_ERR_EADDRNOTAVAIL); 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
+ case EAI_ADDRFAMILY:err = gpg_error (GPG_ERR_EADDRNOTAVAIL); break;
case EAI_SYSTEM: err = gpg_error_from_syserror (); break;
+#endif
default: err = gpg_error (GPG_ERR_UNKNOWN_ERRNO); break;
}
return err;