From: Howard Chu Date: Thu, 28 Jul 2016 22:40:57 +0000 (+0100) Subject: ITS#8460 fix slap_op_time X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f6510ec83bd596d76370faeb612a04a85609dfcb;p=openldap ITS#8460 fix slap_op_time broken in 2d5996ac603391ddbd618425f88eb13e5e0e2cc0 Was allowing tv_usec to exceed 999999 --- diff --git a/servers/slapd/operation.c b/servers/slapd/operation.c index d9a3f30f3f..f68a6255ae 100644 --- a/servers/slapd/operation.c +++ b/servers/slapd/operation.c @@ -173,11 +173,11 @@ slap_op_time(time_t *t, int *nop) tv.tv_usec <= last_time.tv_usec ) { tv.tv_sec = last_time.tv_sec; tv.tv_usec = last_time.tv_usec + 1; - if (tv.tv_usec >= 1000000) { - tv.tv_usec -= 1000000; - tv.tv_sec++; - last_time.tv_sec = tv.tv_sec; - } + } + if (tv.tv_usec >= 1000000) { + tv.tv_usec -= 1000000; + tv.tv_sec++; + last_time.tv_sec = tv.tv_sec; } last_time.tv_usec = tv.tv_usec; ldap_pvt_thread_mutex_unlock( &slap_op_mutex );