Commit f0d77560 authored by Hallvard Furuseth's avatar Hallvard Furuseth
Browse files

More ITS#6262: Also define ldap_pvt_gmtime_[un]lock if localtime_r is missing

parent 13e72602
...@@ -93,16 +93,8 @@ ldap_pvt_ctime LDAP_P(( ...@@ -93,16 +93,8 @@ ldap_pvt_ctime LDAP_P((
# if defined( HAVE_GMTIME_R ) # if defined( HAVE_GMTIME_R )
# define USE_GMTIME_R # define USE_GMTIME_R
# define ldap_pvt_gmtime_lock() (0)
# define ldap_pvt_gmtime_unlock() (0)
# define ldap_pvt_gmtime(timep, result) gmtime_r((timep), (result)) # define ldap_pvt_gmtime(timep, result) gmtime_r((timep), (result))
# else # else
LDAP_F( int )
ldap_pvt_gmtime_lock LDAP_P(( void ));
LDAP_F( int )
ldap_pvt_gmtime_unlock LDAP_P(( void ));
LDAP_F( struct tm * ) LDAP_F( struct tm * )
ldap_pvt_gmtime LDAP_P(( ldap_pvt_gmtime LDAP_P((
LDAP_CONST time_t *timep, LDAP_CONST time_t *timep,
...@@ -119,6 +111,17 @@ ldap_pvt_localtime LDAP_P(( ...@@ -119,6 +111,17 @@ ldap_pvt_localtime LDAP_P((
struct tm *result )); struct tm *result ));
# endif # endif
#if defined( USE_GMTIME_R ) && defined( USE_LOCALTIME_R )
# define ldap_pvt_gmtime_lock() (0)
# define ldap_pvt_gmtime_unlock() (0)
#else
LDAP_F( int )
ldap_pvt_gmtime_lock LDAP_P(( void ));
LDAP_F( int )
ldap_pvt_gmtime_unlock LDAP_P(( void ));
#endif /* USE_GMTIME_R && USE_LOCALTIME_R */
/* Get current time as a structured time */ /* Get current time as a structured time */
struct lutil_tm; struct lutil_tm;
LDAP_F( void ) LDAP_F( void )
......
...@@ -116,7 +116,7 @@ char *ldap_pvt_ctime( const time_t *tp, char *buf ) ...@@ -116,7 +116,7 @@ char *ldap_pvt_ctime( const time_t *tp, char *buf )
#endif #endif
} }
#ifndef USE_GMTIME_R #if !defined( USE_GMTIME_R ) || !defined( USE_LOCALTIME_R )
int int
ldap_pvt_gmtime_lock( void ) ldap_pvt_gmtime_lock( void )
{ {
...@@ -136,7 +136,9 @@ ldap_pvt_gmtime_unlock( void ) ...@@ -136,7 +136,9 @@ ldap_pvt_gmtime_unlock( void )
return ldap_pvt_thread_mutex_unlock( &ldap_int_gmtime_mutex ); return ldap_pvt_thread_mutex_unlock( &ldap_int_gmtime_mutex );
# endif /* LDAP_R_COMPILE */ # endif /* LDAP_R_COMPILE */
} }
#endif /* !USE_GMTIME_R || !USE_LOCALTIME_R */
#ifndef USE_GMTIME_R
struct tm * struct tm *
ldap_pvt_gmtime( const time_t *timep, struct tm *result ) ldap_pvt_gmtime( const time_t *timep, struct tm *result )
{ {
......
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