diff --git a/src/iomux_epoll.c b/src/iomux_epoll.c index 22f964b..65a9eaf 100644 --- a/src/iomux_epoll.c +++ b/src/iomux_epoll.c @@ -183,7 +183,7 @@ again: fd->callback(mux_, fd, events); //be sure not to use fd after the callback, it might been removed. - mux->pending_events[i].data.ptr = NULL; + mux->pending_events[i].data.ptr = NULL; //clear from pending list event_cnt++; } diff --git a/src/iomux_select.c b/src/iomux_select.c index 8b67414..ad39cf9 100644 --- a/src/iomux_select.c +++ b/src/iomux_select.c @@ -168,17 +168,18 @@ again: } if (FD_ISSET(mux->descriptors[i]->fd, &read_set)) { + rc--; events |= MUX_EV_READ; } if (FD_ISSET(mux->descriptors[i]->fd, &write_set)) { + rc--; events |= MUX_EV_WRITE; } if (events) { assert(mux->descriptors[i]->callback != NULL); mux->descriptors[i]->callback(mux_, mux->descriptors[i], events); - rc--; event_cnt++; } }