Commit ba749eb7 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Updated string error handling

parent 659b41ec
......@@ -103,11 +103,12 @@ ldap_pvt_close_socket(LDAP *ld, int s)
#undef TRACE
#define TRACE do { \
char ebuf[128]; \
oslocal_debug(ld, \
"ldap_is_socket_ready: errror on socket %d: errno: %d (%s)\n", \
s, \
errno, \
STRERROR(errno) ); \
AC_STRERROR_R(errno, ebuf, sizeof ebuf)); \
} while( 0 )
/*
......
......@@ -43,6 +43,12 @@
extern int h_errno;
#endif
#ifdef HAVE_HSTRERROR
# define HSTRERROR(e) hstrerror(e)
#else
# define HSTRERROR(e) hp_strerror(e)
#endif
#ifndef LDAP_R_COMPILE
# undef HAVE_REENTRANT_FUNCTIONS
# undef HAVE_CTIME_R
......@@ -189,7 +195,7 @@ int ldap_pvt_gethostbyname_a(
#endif
}
#ifndef GETNAMEINFO
#if !defined( GETNAMEINFO ) && !defined( HAVE_HERROR )
static const char *
hp_strerror( int err )
{
......@@ -249,7 +255,7 @@ int ldap_pvt_get_hname(
alen = sizeof(sin->sin_addr);
} else {
rc = NO_RECOVERY;
*err = (char *)hp_strerror( rc );
*err = (char *)HSTRERROR( rc );
return rc;
}
#if defined( HAVE_GETHOSTBYADDR_R )
......@@ -281,7 +287,7 @@ int ldap_pvt_get_hname(
if (hp) {
strncpy( name, hp->h_name, namelen );
} else {
*err = (char *)hp_strerror( h_errno );
*err = (char *)HSTRERROR( h_errno );
}
LDAP_FREE(buf);
#else /* HAVE_GETHOSTBYADDR_R */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment