Commit 41c0bbab authored by Max Kellermann's avatar Max Kellermann

event/SocketMonitor: don't filter out ERROR/HANGUP

By bit-wise ANDing the reported flags with GetScheduledFlags(), ERROR/HANGUP always get cleared. This means the MPD event loop could never report those conditions.
parent eeb96eb3
......@@ -30,7 +30,7 @@
void
SocketMonitor::Dispatch(unsigned flags) noexcept
{
flags &= GetScheduledFlags();
flags &= GetScheduledFlags() | IMPLICIT_FLAGS;
if (flags != 0)
OnSocketReady(flags);
......
......@@ -57,6 +57,12 @@ public:
static constexpr unsigned ERROR = PollGroup::ERROR;
static constexpr unsigned HANGUP = PollGroup::HANGUP;
/**
* These flags are always reported by epoll_wait() and don't
* need to be registered with epoll_ctl().
*/
static constexpr unsigned IMPLICIT_FLAGS = ERROR|HANGUP;
typedef std::make_signed<size_t>::type ssize_t;
explicit SocketMonitor(EventLoop &_loop) noexcept
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment