From 4a20cd65c51dee104a7d707e4076ec524d3e4219 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 10 Sep 2014 17:10:54 -0600 Subject: [PATCH] clock_gettime.c: Fix a cornercase bug in clock_gettime() --- sched/clock/clock_gettime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;