From 89edba14f0dfb74f0694a20724405743ece00017 Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Wed, 24 Sep 2014 19:00:09 +0200 Subject: Sort epoll_wait() output earlier --- utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils.c b/utils.c index d5df179..8be61d6 100644 --- a/utils.c +++ b/utils.c @@ -1223,12 +1223,12 @@ poller_run (struct poller *self) self->dispatch_next = 0; self->dispatch_total = n_fds; - poller_timers_dispatch (&self->timers); - poller_idle_dispatch (self->idle); - // Sort them by file descriptor number for binary search qsort (self->revents, n_fds, sizeof *self->revents, poller_compare_fds); + poller_timers_dispatch (&self->timers); + poller_idle_dispatch (self->idle); + while (self->dispatch_next < self->dispatch_total) { struct epoll_event *revents = self->revents + self->dispatch_next; -- cgit v1.2.3-70-g09d2