]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/ctxcsn.c
alternate fix to ITS#3916
[openldap] / servers / slapd / ctxcsn.c
index 3e99830e3ceb1e949545e4541f4eee44dbd4800b..6d29007b58ef542dedff258f4a381626f4540633 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2003-2004 The OpenLDAP Foundation.
+ * Copyright 2003-2005 The OpenLDAP Foundation.
  * Portions Copyright 2003 IBM Corporation.
  * All rights reserved.
  *
@@ -37,7 +37,6 @@ slap_get_commit_csn(
 )
 {
        struct slap_csn_entry *csne, *committed_csne = NULL;
-       int i = 0;
 
        if ( maxcsn ) {
                BER_BVZERO( maxcsn );
@@ -125,7 +124,6 @@ slap_create_context_csn_entry(
        struct berval *context_csn )
 {
        Entry* e;
-       int rc;
 
        struct berval bv;
 
@@ -183,7 +181,13 @@ slap_get_csn(
 {
        if ( csn == NULL ) return LDAP_OTHER;
 
+#ifndef HAVE_GMTIME_R
+       ldap_pvt_thread_mutex_lock( &gmtime_mutex );
+#endif
        csn->bv_len = lutil_csnstr( csnbuf, len, 0, 0 );
+#ifndef HAVE_GMTIME_R
+       ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
+#endif
        csn->bv_val = csnbuf;
 
        if ( manage_ctxcsn )