]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9537 slap_op_time: avoid duplicates across restarts
authorHoward Chu <hyc@openldap.org>
Tue, 27 Apr 2021 16:10:51 +0000 (17:10 +0100)
committerHoward Chu <hyc@openldap.org>
Tue, 27 Apr 2021 16:10:51 +0000 (17:10 +0100)
Initialize last_ times with current time sec & usec

servers/slapd/operation.c

index e5010f9e457b3cb467e1b4fe01eeeff4d6665f3c..31cd2da480fbe5ea555acd9bc66b09c516ca8a90 100644 (file)
@@ -43,7 +43,11 @@ static int last_incr;
 
 void slap_op_init(void)
 {
+       struct timeval tv;
        ldap_pvt_thread_mutex_init( &slap_op_mutex );
+       gettimeofday( &tv, NULL );
+       last_time = tv.tv_sec;
+       last_incr = tv.tv_usec;
 }
 
 void slap_op_destroy(void)