summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorxbasel <103044017+xbasel@users.noreply.github.com>2022-10-30 01:24:12 +0200
committerGitHub <noreply@github.com>2022-10-29 16:24:12 -0700
commit5b102e2339f45f1a688215496a884893accec527 (patch)
tree73aac091a647ac70930cf0b8f179f7c006154f0d /src
parentc0d7226274feb6a519a17a169421295da827a30c (diff)
downloadredis-5b102e2339f45f1a688215496a884893accec527.tar.gz
Don't process file events if AE_FILE_EVENTS isn't set. (#11428)
All current usage of the function are correct, but in the future it might change.
Diffstat (limited to 'src')
-rw-r--r--src/ae.c5
1 files changed, 5 insertions, 0 deletions
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);