]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix _cupsCondWait again.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 14 Mar 2018 22:06:38 +0000 (18:06 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 14 Mar 2018 22:06:38 +0000 (18:06 -0400)
cups/thread.c

index c52f77710d1842694a1431131d1c1a30473a70e6..717574ac7f962b8bda1b63ab9fd7751a5d652518 100644 (file)
@@ -49,13 +49,12 @@ _cupsCondWait(_cups_cond_t  *cond,  /* I - Condition */
 {
   if (timeout > 0.0)
   {
-    struct timeval curtime;            /* Current time */
     struct timespec abstime;           /* Timeout */
 
-    gettimeofday(&curtime, NULL);
+    clock_gettime(CLOCK_REALTIME, &abstime);
 
-    abstime.tv_sec  = (long)timeout + curtime.tv_sec;
-    abstime.tv_nsec = (long)(1000000000 * (timeout - (long)timeout + 1000 * curtime.tv_usec));
+    abstime.tv_sec  += (long)timeout;
+    abstime.tv_nsec += (long)(1000000000 * (timeout - (long)timeout));
 
     while (abstime.tv_nsec >= 1000000000)
     {