diff --git a/src/ae.c b/src/ae.c index b05cf563c..fd6192f3f 100644 --- a/src/ae.c +++ b/src/ae.c @@ -403,6 +403,11 @@ int aeProcessEvents(aeEventLoop *eventLoop, int flags) * some event fires. */ numevents = aeApiPoll(eventLoop, tvp); + /* Don't process file events if not requested. */ + if (!(flags & AE_FILE_EVENTS)) { + numevents = 0; + } + /* After sleep callback. */ if (eventLoop->aftersleep != NULL && flags & AE_CALL_AFTER_SLEEP) eventLoop->aftersleep(eventLoop);