mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-23 08:09:34 -05:00
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
This commit is contained in:
parent
0037524bf1
commit
9e7accb034
2 changed files with 4 additions and 3 deletions
|
|
@ -299,6 +299,7 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb,
|
||||||
if (host != NULL) {
|
if (host != NULL) {
|
||||||
#ifdef HAVE_GETADDRINFO
|
#ifdef HAVE_GETADDRINFO
|
||||||
char serv[7];
|
char serv[7];
|
||||||
|
int err;
|
||||||
struct addrinfo hints, *res, *sai;
|
struct addrinfo hints, *res, *sai;
|
||||||
|
|
||||||
memset( &hints, '\0', sizeof(hints) );
|
memset( &hints, '\0', sizeof(hints) );
|
||||||
|
|
@ -306,8 +307,8 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb,
|
||||||
hints.ai_socktype = SOCK_STREAM;
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
|
|
||||||
snprintf(serv, sizeof serv, "%d", ntohs(port));
|
snprintf(serv, sizeof serv, "%d", ntohs(port));
|
||||||
if ( getaddrinfo(host, serv, &hints, &res) ) {
|
if ( err = getaddrinfo(host, serv, &hints, &res) ) {
|
||||||
osip_debug(ld, "ldap_connect_to_host:getaddrinfo failed\n",0,0,0);
|
osip_debug(ld, "ldap_connect_to_host: getaddrinfo failed: %s\n", AC_GAI_STRERROR(err), 0, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
sai = res;
|
sai = res;
|
||||||
|
|
|
||||||
|
|
@ -228,7 +228,7 @@ static int slap_get_listener_addresses(
|
||||||
/* host specifies a service in this case */
|
/* host specifies a service in this case */
|
||||||
if (err = getaddrinfo(NULL, host, &hints, &res)) {
|
if (err = getaddrinfo(NULL, host, &hints, &res)) {
|
||||||
Debug( LDAP_DEBUG_ANY, "daemon: getaddrinfo failed: %s\n",
|
Debug( LDAP_DEBUG_ANY, "daemon: getaddrinfo failed: %s\n",
|
||||||
gai_strerror(err), 0, 0);
|
AC_GAI_STRERROR(err), 0, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue