From b45c3d5cb86a5f145577384190a27d3c1d1e8da8 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Tue, 24 Oct 2017 16:04:18 +0200 Subject: [PATCH] timespec_newer(): time a should be > or >= to b Time comparision should be >= not just >. May seem a bit silly to nitpick like this since we're comparing nano seconds, but on systems with no high-res timers this happens more often than you would like. Signed-off-by: Joachim Nilsson --- src/cond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cond.c b/src/cond.c index 48e71e5d..98c3895b 100644 --- a/src/cond.c +++ b/src/cond.c @@ -34,7 +34,7 @@ static inline int timespec_newer(const struct timespec *a, if (a->tv_sec != b->tv_sec) return a->tv_sec > b->tv_sec; - return a->tv_nsec > b->tv_nsec; + return a->tv_nsec >= b->tv_nsec; } const char *condstr(enum cond_state s)