Sort epoll_wait() output earlier

This commit is contained in:
Přemysl Eric Janouch 2014-09-24 19:00:09 +02:00
parent 50e27cf3d8
commit 89edba14f0
1 changed files with 3 additions and 3 deletions

View File

@ -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;