clock_gettime.c: Fix a cornercase bug in clock_gettime()

This commit is contained in:
Gregory Nutt 2014-09-10 17:10:54 -06:00
parent bb9e709c55
commit 4a20cd65c5
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp)
/* Handle carry to seconds. */ /* Handle carry to seconds. */
if (ts.tv_nsec > NSEC_PER_SEC) if (ts.tv_nsec >= NSEC_PER_SEC)
{ {
carry = ts.tv_nsec / NSEC_PER_SEC; carry = ts.tv_nsec / NSEC_PER_SEC;
ts.tv_sec += carry; ts.tv_sec += carry;