X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Futil-int.c;h=6b24d63565db919789a1ef4502ba9e1d33a9fc5d;hb=de01a6e3d791d3458549d2ceeccf4d7e0477ff78;hp=e4975e0ff452aba2344eefdf2d165b39b5bcb3ee;hpb=cc4d5c10df67c67927d878da9dcd593125717cb2;p=openldap
diff --git a/libraries/libldap/util-int.c b/libraries/libldap/util-int.c
index e4975e0ff4..6b24d63565 100644
--- a/libraries/libldap/util-int.c
+++ b/libraries/libldap/util-int.c
@@ -1,7 +1,7 @@
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software .
*
- * Copyright 1998-2004 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
* Portions Copyright 1998 A. Hartgers.
* All rights reserved.
*
@@ -59,9 +59,9 @@ extern int h_errno;
# include
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
@@ -110,12 +110,14 @@ char *ldap_pvt_ctime( const time_t *tp, char *buf )
#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,
@@ -195,7 +197,7 @@ int ldap_pvt_gethostbyname_a(
#endif
}
-#if !defined( GETNAMEINFO ) && !defined( HAVE_HERROR )
+#if !defined( HAVE_GETNAMEINFO ) && !defined( HAVE_HSTRERROR )
static const char *
hp_strerror( int err )
{
@@ -301,7 +303,7 @@ int ldap_pvt_get_hname(
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 );
@@ -463,7 +465,7 @@ static int copy_hostent(
int n_alias=0;
int total_alias_len=0;
int n_addr=0;
- int total_addr_len;
+ int total_addr_len=0;
int total_len;
/* calculate the size needed for the buffer */