From 8bab5733d7385271bb55a478e1744b00da3dd393 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 18 Oct 2020 20:04:15 +0200 Subject: [PATCH] event/Loop: add assertions --- src/event/Loop.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/event/Loop.cxx b/src/event/Loop.cxx index 05c5bac1d..63e4255a9 100644 --- a/src/event/Loop.cxx +++ b/src/event/Loop.cxx @@ -118,6 +118,7 @@ EventLoop::AddFD(int fd, unsigned events, SocketEvent &event) noexcept #ifdef HAVE_THREADED_EVENT_LOOP assert(!IsAlive() || IsInside()); #endif + assert(events != 0); if (!poll_group.Add(fd, events, &event)) return false; @@ -132,6 +133,7 @@ EventLoop::ModifyFD(int fd, unsigned events, SocketEvent &event) noexcept #ifdef HAVE_THREADED_EVENT_LOOP assert(!IsAlive() || IsInside()); #endif + assert(events != 0); return poll_group.Modify(fd, events, &event); }