Skip to content

Commit

Permalink
sort by FD first, not filter.
Browse files Browse the repository at this point in the history
there are really only 2 filters used, but multiple FDs
  • Loading branch information
alandekok committed Oct 13, 2017
1 parent 71bdf7b commit e618d08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/util/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,10 @@ static int fr_event_fd_cmp(void const *a, void const *b)
fr_event_fd_t const *ev_a = a, *ev_b = b;
int ret;

ret = (ev_a->filter > ev_b->filter) - (ev_b->filter < ev_b->filter);
ret = (ev_a->fd < ev_b->fd) - (ev_a->fd > ev_b->fd);
if (ret != 0) return ret;

return (ev_a->fd < ev_b->fd) - (ev_a->fd > ev_b->fd);
return (ev_a->filter > ev_b->filter) - (ev_b->filter < ev_b->filter);
}

/** Return the number of file descriptors is_registered with this event loop
Expand Down

1 comment on commit e618d08

@arr2036
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, true.

Please sign in to comment.