]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/repl.c
Removed unnecessary definition that is already in core.schema.
[openldap] / servers / slapd / repl.c
index f0f8818a3c3bd4ae35fefd0d917d9ecf2452265b..0c3f04a7cf5a8072aae3ef5ce1e44a2ec0febbff 100644 (file)
@@ -8,7 +8,9 @@
 #include <ac/ctype.h>
 #include <ac/socket.h>
 
+#ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>
+#endif
 
 #include "slap.h"
 
@@ -25,7 +27,6 @@ replog(
        LDAPModList     *ml;
        Entry   *e;
        char    *newrdn, *tmp;
-       int     deleteoldrdn;
        FILE    *fp, *lfp;
        int     len, i;
 
@@ -33,10 +34,10 @@ replog(
                return;
        }
 
-       pthread_mutex_lock( &replog_mutex );
+       ldap_pvt_thread_mutex_lock( &replog_mutex );
        if ( (fp = lock_fopen( be->be_replogfile ? be->be_replogfile :
            replogfile, "a", &lfp )) == NULL ) {
-               pthread_mutex_unlock( &replog_mutex );
+               ldap_pvt_thread_mutex_unlock( &replog_mutex );
                return;
        }
 
@@ -44,7 +45,7 @@ replog(
            i++ ) {
                fprintf( fp, "replica: %s\n", be->be_replica[i] );
        }
-       fprintf( fp, "time: %ld\n", (long) currenttime );
+       fprintf( fp, "time: %ld\n", (long) slap_get_time() );
        fprintf( fp, "dn: %s\n", dn );
 
        switch ( optype ) {
@@ -92,15 +93,15 @@ replog(
        case LDAP_REQ_ADD:
                e = change;
                fprintf( fp, "changetype: add\n" );
-               pthread_mutex_lock( &entry2str_mutex );
+               ldap_pvt_thread_mutex_lock( &entry2str_mutex );
                tmp = entry2str( e, &len, 0 );
                while ( (tmp = strchr( tmp, '\n' )) != NULL ) {
                        tmp++;
-                       if ( ! isspace( *tmp ) )
+                       if ( ! isspace( (unsigned char) *tmp ) )
                                break;
                }
                fprintf( fp, "%s", tmp );
-               pthread_mutex_unlock( &entry2str_mutex );
+               ldap_pvt_thread_mutex_unlock( &entry2str_mutex );
                break;
 
        case LDAP_REQ_DELETE:
@@ -116,5 +117,5 @@ replog(
        fprintf( fp, "\n" );
 
        lock_fclose( fp, lfp );
-       pthread_mutex_unlock( &replog_mutex );
+       ldap_pvt_thread_mutex_unlock( &replog_mutex );
 }