From 8825cddd0d8ed6dad00924ef382139da51ca3fc4 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Thu, 29 Nov 2012 12:37:04 +0100 Subject: [PATCH] Allow multiple timeouts to expire at the exact same time. --- src/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/event.c b/src/event.c index 6827dc0..71213bc 100644 --- a/src/event.c +++ b/src/event.c @@ -36,7 +36,7 @@ static int io_compare(const io_t *a, const io_t *b) { static int timeout_compare(const timeout_t *a, const timeout_t *b) { struct timeval diff; timersub(&a->tv, &b->tv, &diff); - return diff.tv_sec ?: diff.tv_usec; + return diff.tv_sec ?: diff.tv_usec ?: a < b ? -1 : a > b ? 1 : 0; } static int signal_compare(const signal_t *a, const signal_t *b) { -- 2.25.1