#include <ac/ctype.h>
#include <ac/socket.h>
+#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
+#endif
#include "slap.h"
LDAPModList *ml;
Entry *e;
char *newrdn, *tmp;
- int deleteoldrdn;
FILE *fp, *lfp;
int len, i;
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;
}
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 ) {
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:
fprintf( fp, "\n" );
lock_fclose( fp, lfp );
- pthread_mutex_unlock( &replog_mutex );
+ ldap_pvt_thread_mutex_unlock( &replog_mutex );
}