chiark / gitweb /
sd-event: improve debug message when we fail to remove and fd from an epoll
authorLennart Poettering <lennart@poettering.net>
Mon, 31 Aug 2015 11:07:24 +0000 (13:07 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:19:06 +0000 (10:19 +0100)
Let's help users to debug issues with epoll fd removal by printing the
name of the event source.

src/libelogind/sd-event/sd-event.c

index 871ea8d..a14ade2 100644 (file)
@@ -481,7 +481,8 @@ static void source_io_unregister(sd_event_source *s) {
                 return;
 
         r = epoll_ctl(s->event->epoll_fd, EPOLL_CTL_DEL, s->io.fd, NULL);
-        assert_log(r >= 0);
+        if (r < 0)
+                log_debug_errno(errno, "Failed to remove source %s from epoll: %m", strna(s->description));
 
         s->io.registered = false;
 }