Allow multiple timeouts to expire at the exact same time.

This commit is contained in:
Guus Sliepen 2012-11-29 12:37:04 +01:00
parent 6bc5d626a8
commit 8825cddd0d

View file

@ -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) {