Skip to content

Commit c56f53b

Browse files
committed
Fixed event type fetching with SELECT IO multiplexing
1 parent af31a2e commit c56f53b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/ev.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ static int ev_api_get_event_type(struct ev_ctx *ctx, int idx) {
296296
// We want to remember the previous events only if they're not of type
297297
// CLOSE or TIMER
298298
int mask = ev_mask & (EV_CLOSEFD|EV_TIMERFD) ? ev_mask : 0;
299+
if (!FD_ISSET(idx, &s_api->_rfds) && !FD_ISSET(idx, &s_api->_wfds))
300+
return EV_NONE;
299301
if (FD_ISSET(idx, &s_api->_rfds)) mask |= EV_READ;
300302
if (FD_ISSET(idx, &s_api->_wfds)) mask |= EV_WRITE;
301303
return mask;

0 commit comments

Comments
 (0)