Check both seconds and nanoseconds are zero, only checking nanoseconds

is zero may trigger timeout too early. It seems a copy&paste bug.
This commit is contained in:
David Xu 2012-02-19 08:17:14 +00:00
parent 7dc0ace10e
commit 879d152454
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=231906

View File

@ -205,7 +205,7 @@ _thr_umtx_timedwait_uint(volatile u_int *mtx, u_int id, int clockid,
if (abstime != NULL) {
clock_gettime(clockid, &ts);
TIMESPEC_SUB(&ts2, abstime, &ts);
if (ts2.tv_sec < 0 || ts2.tv_nsec <= 0)
if (ts2.tv_sec < 0 || (ts2.tv_sec == 0 && ts2.tv_nsec <= 0))
return (ETIMEDOUT);
tsp = &ts2;
} else {