mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
tevent: use DLIST_DEMOTE() before calling on fde handler after select() and poll()
This makes sure we don't preferr events which are at the beginning of the list. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
b31767bf27
commit
8764ec80bb
@ -601,6 +601,7 @@ static int poll_event_loop_poll(struct tevent_context *ev,
|
||||
*/
|
||||
flags &= fde->flags;
|
||||
if (flags != 0) {
|
||||
DLIST_DEMOTE(ev->fd_events, fde, struct tevent_fd);
|
||||
fde->handler(ev, fde, flags, fde->private_data);
|
||||
return 0;
|
||||
}
|
||||
|
@ -221,6 +221,7 @@ static int select_event_loop_select(struct select_event_context *select_ev, stru
|
||||
flags |= TEVENT_FD_WRITE;
|
||||
}
|
||||
if (flags) {
|
||||
DLIST_DEMOTE(select_ev->ev->fd_events, fde, struct tevent_fd);
|
||||
fde->handler(select_ev->ev, fde, flags, fde->private_data);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user