logs changes even if no appropriate replica (or none at all) is defined (ITS#1335)

This commit is contained in:
Pierangelo Masarati 2001-09-19 09:09:51 +00:00
parent 0937019e21
commit f082328f45

View file

@ -58,7 +58,11 @@ replog(
struct replog_moddn *moddn; struct replog_moddn *moddn;
char *tmp; char *tmp;
FILE *fp, *lfp; FILE *fp, *lfp;
int len, i, count = 0; int len, i;
/* undef NO_LOG_WHEN_NO_REPLICAS */
#ifdef NO_LOG_WHEN_NO_REPLICAS
int count = 0;
#endif
if ( be->be_replogfile == NULL && replogfile == NULL ) { if ( be->be_replogfile == NULL && replogfile == NULL ) {
return; return;
@ -100,10 +104,13 @@ replog(
} }
fprintf( fp, "replica: %s\n", be->be_replica[i]->ri_host ); fprintf( fp, "replica: %s\n", be->be_replica[i]->ri_host );
#ifdef NO_LOG_WHEN_NO_REPLICAS
++count; ++count;
#endif
} }
ch_free( tmp ); ch_free( tmp );
#ifdef NO_LOG_WHEN_NO_REPLICAS
if ( count == 0 ) { if ( count == 0 ) {
/* if no replicas matched, drop the log /* if no replicas matched, drop the log
* (should we log it anyway?) */ * (should we log it anyway?) */
@ -112,6 +119,7 @@ replog(
return; return;
} }
#endif
fprintf( fp, "time: %ld\n", (long) slap_get_time() ); fprintf( fp, "time: %ld\n", (long) slap_get_time() );
fprintf( fp, "dn: %s\n", dn ); fprintf( fp, "dn: %s\n", dn );