}
for (int i = 0; i < n; ++i) {
- if (_find_io_event_handler(events[i].data.fd) == NULL) {
- VINE_LOGI("Removed fd[%d]", events[i].data.fd);
+ vine_epoll_io_event_handler *h = (vine_epoll_io_event_handler *)events[i].data.ptr;
+
+ if (!h)
+ continue;
+
+ if (_find_io_event_handler(h->fd) == NULL) {
+ VINE_LOGI("Removed fd[%d]", h->fd);
continue;
}
- vine_epoll_io_event_handler *h = (vine_epoll_io_event_handler *)events[i].data.ptr;
- if (h && h->fd > 0 && h->handler)
+ if (h->handler)
h->handler(h->fd, events[i].events, h->user_data);
}
} while (!__cleanup);