1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 16:55:09 +00:00

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.
This commit is contained in:
Andreas Kling 2020-07-06 23:02:07 +02:00
parent f27e5ac68d
commit e5933ec739

View file

@ -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()));
}
}