From: Kurt Zeilenga Date: Thu, 19 Oct 2000 18:05:11 +0000 (+0000) Subject: This patch replaces gai_strerror with AC_GAI_STRERROR in daemon.c and also X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1699 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9e7accb034c6f2ce12fbd11f99c4071c9936943d;p=openldap This patch replaces gai_strerror with AC_GAI_STRERROR in daemon.c and also uses AC_GAI_STRERROR to report getaddrinfo failures in os-ip.c -- Stig Venass --- diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index b58962607a..8cef102b3e 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -299,6 +299,7 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb, if (host != NULL) { #ifdef HAVE_GETADDRINFO char serv[7]; + int err; struct addrinfo hints, *res, *sai; memset( &hints, '\0', sizeof(hints) ); @@ -306,8 +307,8 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb, hints.ai_socktype = SOCK_STREAM; snprintf(serv, sizeof serv, "%d", ntohs(port)); - if ( getaddrinfo(host, serv, &hints, &res) ) { - osip_debug(ld, "ldap_connect_to_host:getaddrinfo failed\n",0,0,0); + if ( err = getaddrinfo(host, serv, &hints, &res) ) { + osip_debug(ld, "ldap_connect_to_host: getaddrinfo failed: %s\n", AC_GAI_STRERROR(err), 0, 0); return -1; } sai = res; diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index fe735bc9a2..c9eb693cdc 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -228,7 +228,7 @@ static int slap_get_listener_addresses( /* host specifies a service in this case */ if (err = getaddrinfo(NULL, host, &hints, &res)) { Debug( LDAP_DEBUG_ANY, "daemon: getaddrinfo failed: %s\n", - gai_strerror(err), 0, 0); + AC_GAI_STRERROR(err), 0, 0); return -1; } } else