summaryrefslogtreecommitdiff
path: root/Libraries/LibCore/EventLoop.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-07-06 23:02:07 +0200
committerAndreas Kling <kling@serenityos.org>2020-07-06 23:17:10 +0200
commite5933ec739aa9b896b2c7bb5aa8e7457b343adf4 (patch)
tree0c3fb1798fff54afbe9c99d944aa3889cbadd096 /Libraries/LibCore/EventLoop.cpp
parentf27e5ac68d27db304c388b1e8c6f59bb044380c4 (diff)
downloadserenity-e5933ec739aa9b896b2c7bb5aa8e7457b343adf4.zip
LibCore: Only deliver Read/Write events to listening notifiers
If a notifier has disabled read/write notifications via its event mask, we should not spam it with events, even if they have a hook callback.
Diffstat (limited to 'Libraries/LibCore/EventLoop.cpp')
-rw-r--r--Libraries/LibCore/EventLoop.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibCore/EventLoop.cpp b/Libraries/LibCore/EventLoop.cpp
index 9619cbe521..6c0a78f4c9 100644
--- a/Libraries/LibCore/EventLoop.cpp
+++ b/Libraries/LibCore/EventLoop.cpp
@@ -519,11 +519,11 @@ try_select_again:;
for (auto& notifier : *s_notifiers) {
if (FD_ISSET(notifier->fd(), &rfds)) {
- if (notifier->on_ready_to_read)
+ if (notifier->event_mask() & Notifier::Event::Read)
post_event(*notifier, make<NotifierReadEvent>(notifier->fd()));
}
if (FD_ISSET(notifier->fd(), &wfds)) {
- if (notifier->on_ready_to_write)
+ if (notifier->event_mask() & Notifier::Event::Write)
post_event(*notifier, make<NotifierWriteEvent>(notifier->fd()));
}
}