From: Michael R Sweet Date: Wed, 14 Mar 2018 22:06:38 +0000 (-0400) Subject: Fix _cupsCondWait again. X-Git-Tag: v2.3b4~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84047a015c344936ef46b514099ab01dbea3cfd2;p=thirdparty%2Fcups.git Fix _cupsCondWait again. --- diff --git a/cups/thread.c b/cups/thread.c index c52f77710d..717574ac7f 100644 --- a/cups/thread.c +++ b/cups/thread.c @@ -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) {