/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2005 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
* Portions Copyright 1998 A. Hartgers.
* All rights reserved.
*
# include <ldap_pvt_thread.h>
ldap_pvt_thread_mutex_t ldap_int_resolv_mutex;
-#if (defined( HAVE_CTIME_R ) || defined( HAVE_REENTRANT_FUNCTIONS)) \
- && defined( CTIME_R_NARGS )
-# define USE_CTIME_R
+# if (defined( HAVE_CTIME_R ) || defined( HAVE_REENTRANT_FUNCTIONS)) \
+ && defined( CTIME_R_NARGS )
+# define USE_CTIME_R
# else
static ldap_pvt_thread_mutex_t ldap_int_ctime_mutex;
# endif
#define BUFSTART (1024-32)
#define BUFMAX (32*1024-32)
+#if defined(LDAP_R_COMPILE)
static char *safe_realloc( char **buf, int len );
-#if !defined(HAVE_GETHOSTBYNAME_R) && defined(LDAP_R_COMPILE)
+#if !(defined(HAVE_GETHOSTBYNAME_R) && defined(HAVE_GETHOSTBYADDR_R))
static int copy_hostent( struct hostent *res,
char **buf, struct hostent * src );
#endif
+#endif
int ldap_pvt_gethostbyname_a(
const char *name,
#endif
}
-#if !defined( GETNAMEINFO ) && !defined( HAVE_HERROR )
+#if !defined( HAVE_GETNAMEINFO ) && !defined( HAVE_HSTRERROR )
static const char *
hp_strerror( int err )
{
rc = 0;
} else {
rc = h_errno;
- *err = (char *)hp_strerror( h_errno );
+ *err = (char *)HSTRERROR( h_errno );
}
#if defined( LDAP_R_COMPILE )
ldap_pvt_thread_mutex_unlock( &ldap_int_resolv_mutex );