#endif
int subsets = 0;
long now = slap_get_time();
+ char *replogfile;
- if ( op->o_bd->be_replogfile == NULL && frontendDB->be_replogfile == NULL ) {
+ replogfile = op->o_bd->be_replogfile ? op->o_bd->be_replogfile :
+ frontendDB->be_replogfile;
+ if ( !replogfile ) {
return;
}
- ldap_pvt_thread_mutex_lock( &SLAPD_GLOBAL(replog_mutex) );
- if ( (fp = lock_fopen( op->o_bd->be_replogfile ? op->o_bd->be_replogfile :
- frontendDB->be_replogfile, "a", &lfp )) == NULL ) {
- ldap_pvt_thread_mutex_unlock( &SLAPD_GLOBAL(replog_mutex) );
+ ldap_pvt_thread_mutex_lock( &replog_mutex );
+ if ( (fp = lock_fopen( replogfile, "a", &lfp )) == NULL ) {
+ ldap_pvt_thread_mutex_unlock( &replog_mutex );
return;
}
/* if no replicas matched, drop the log
* (should we log it anyway?) */
lock_fclose( fp, lfp );
- ldap_pvt_thread_mutex_unlock( &SLAPD_GLOBAL(replog_mutex) );
+ ldap_pvt_thread_mutex_unlock( &replog_mutex );
return;
}
}
lock_fclose( fp, lfp );
- ldap_pvt_thread_mutex_unlock( &SLAPD_GLOBAL(replog_mutex) );
+ ldap_pvt_thread_mutex_unlock( &replog_mutex );
}
static void