diff --git a/Userland/Libraries/LibCore/Event.h b/Userland/Libraries/LibCore/Event.h index ecacfbe460..11755f58ba 100644 --- a/Userland/Libraries/LibCore/Event.h +++ b/Userland/Libraries/LibCore/Event.h @@ -83,6 +83,8 @@ enum class NotificationType { None = 0, Read = 1, Write = 2, + HangUp = 4, + Error = 8, }; AK_ENUM_BITWISE_OPERATORS(NotificationType); diff --git a/Userland/Libraries/LibCore/EventLoopImplementationUnix.cpp b/Userland/Libraries/LibCore/EventLoopImplementationUnix.cpp index f6ff960989..506501cf06 100644 --- a/Userland/Libraries/LibCore/EventLoopImplementationUnix.cpp +++ b/Userland/Libraries/LibCore/EventLoopImplementationUnix.cpp @@ -267,6 +267,10 @@ try_select_again: type |= NotificationType::Read; if (has_flag(revents, POLLOUT)) type |= NotificationType::Write; + if (has_flag(revents, POLLHUP)) + type |= NotificationType::HangUp; + if (has_flag(revents, POLLERR)) + type |= NotificationType::Error; type &= notifier.type(); if (type != NotificationType::None) ThreadEventQueue::current().post_event(notifier, make(notifier.fd(), type));