dispatch: discard unselected events
The kernel might return more events than we're interested in. Clear
those at all times. We require callers to explicitly ask for EPOLLHUP
and EPOLLERR.
@@ -150,7 +150,7 @@ int dispatch_context_poll(DispatchContext *ctx, int timeout) {
e = &events[--r];
f = e->data.ptr;
- f->events |= e->events;
+ f->events |= e->events & f->kernel_mask;
if ((f->events & f->user_mask) &&
!c_list_is_linked(&f->ready_link))
c_list_link_tail(f->ready_list, &f->ready_link);
