poll_ev = talloc_get_type_abort(
ev->additional_data, struct poll_event_context);
- poll_ev->fdes[del_idx] = NULL;
- poll_ev->deleted = true;
- poll_event_wake_pollthread(poll_ev);
-done:
- return tevent_common_fd_destructor(fde);
-}
-
-static int poll_fresh_fde_destructor(struct tevent_fd *fde)
-{
- struct tevent_context *ev = fde->event_ctx;
- struct poll_event_context *poll_ev;
+ if (del_idx == UINT64_MAX) {
- if (ev == NULL) {
+ DLIST_REMOVE(poll_ev->fresh, fde);
goto done;
}
- poll_ev = talloc_get_type_abort(
- ev->additional_data, struct poll_event_context);
- DLIST_REMOVE(poll_ev->fresh, fde);
+ poll_ev->fdes[del_idx] = NULL;
+ poll_ev->deleted = true;
+ poll_event_wake_pollthread(poll_ev);
done:
return tevent_common_fd_destructor(fde);
}
fde->additional_flags = UINT64_MAX;
fde->additional_data = NULL;
DLIST_ADD(poll_ev->fresh, fde);
- talloc_set_destructor(fde, poll_fresh_fde_destructor);
+ talloc_set_destructor(fde, poll_event_fd_destructor);
}
/*
DLIST_REMOVE(poll_ev->fresh, fde);
DLIST_ADD(ev->fd_events, fde);
- talloc_set_destructor(fde, poll_event_fd_destructor);
-
poll_ev->num_fds += 1;
}
return true;