diff --git a/sched/clock/clock_gettime.c b/sched/clock/clock_gettime.c index 3b716ffcfd..c422252bc9 100644 --- a/sched/clock/clock_gettime.c +++ b/sched/clock/clock_gettime.c @@ -150,7 +150,7 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp) /* 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; ts.tv_sec += carry;