*/
ldap_pvt_thread_pool_t connection_pool;
int connection_pool_max = SLAP_MAX_WORKER_THREADS;
+#ifndef HAVE_GMTIME_R
ldap_pvt_thread_mutex_t gmtime_mutex;
+#endif
#if defined( SLAPD_CRYPT ) || defined( SLAPD_SPASSWD )
ldap_pvt_thread_mutex_t passwd_mutex;
#endif
}
#endif
+#ifndef HAVE_GMTIME_R
ldap_pvt_thread_mutex_init( &gmtime_mutex );
+#endif
#if defined( SLAPD_CRYPT ) || defined( SLAPD_SPASSWD )
ldap_pvt_thread_mutex_init( &passwd_mutex );
#endif
if ( SLAP_LASTMOD( op->o_bd )) {
struct tm *ltm;
+#ifdef HAVE_GMTIME_R
+ struct tm ltm_buf;
+#endif
time_t now = slap_get_time();
+#ifdef HAVE_GMTIME_R
+ ltm = gmtime_r( &now, <m_buf );
+#else
ldap_pvt_thread_mutex_lock( &gmtime_mutex );
ltm = gmtime( &now );
+#endif /* HAVE_GMTIME_R */
lutil_gentime( timebuf, sizeof(timebuf), ltm );
slap_get_csn( op, csnbuf, sizeof(csnbuf), &csn, 1 );
+#ifndef HAVE_GMTIME_R
ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
+#endif
timestamp.bv_val = timebuf;
timestamp.bv_len = strlen(timebuf);
#if defined( SLAPD_CRYPT ) || defined( SLAPD_SPASSWD )
LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) passwd_mutex;
#endif
+#ifndef HAVE_GMTIME_R
LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) gmtime_mutex;
+#endif
LDAP_SLAPD_V (AccessControl *) global_acl;
{
struct tm *ltm;
+#ifdef HAVE_GMTIME_R
+ struct tm ltm_buf;
+#endif
char timebuf[ LDAP_LUTIL_GENTIME_BUFSIZE ];
/*
* AND modified at server startup time ...
*/
+#ifdef HAVE_GMTIME_R
+ ltm = gmtime_r( &starttime, <m_buf );
+#else
ldap_pvt_thread_mutex_lock( &gmtime_mutex );
ltm = gmtime( &starttime );
+#endif /* HAVE_GMTIME_R */
lutil_gentime( timebuf, sizeof(timebuf), ltm );
+#ifndef HAVE_GMTIME_R
ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
+#endif
vals[0].bv_val = timebuf;
vals[0].bv_len = strlen( timebuf );