]> git.sur5r.net Git - openldap/commitdiff
ITS#8460 fix slap_op_time
authorHoward Chu <hyc@openldap.org>
Thu, 28 Jul 2016 22:40:57 +0000 (23:40 +0100)
committerHoward Chu <hyc@openldap.org>
Thu, 28 Jul 2016 22:40:57 +0000 (23:40 +0100)
broken in 2d5996ac603391ddbd618425f88eb13e5e0e2cc0
Was allowing tv_usec to exceed 999999

servers/slapd/operation.c

index d9a3f30f3f46b897b83feec6dfd2e1bdc2e82df1..f68a6255ae245b923c4a697a80c27bb70b79b2bb 100644 (file)
@@ -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 );