]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
event-loop: Fix debug-log "failed to delete fd # from epoll watch list" spam
authorHans de Goede <hdegoede@redhat.com>
Tue, 18 Feb 2020 20:16:38 +0000 (21:16 +0100)
committerHans de Goede <hdegoede@redhat.com>
Mon, 9 Mar 2020 07:47:34 +0000 (08:47 +0100)
The boot server uses a disconnect handler which closes the fd, this
causes deleting the fd from the epoll watch list to fail with an EBADF
error. Since the fd was closed it was already removed from the epoll
watch list, so the failure is harmless, silence these errors getting logged
to the debug logs.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
src/libply/ply-event-loop.c

index 0e8ad7c86d75dc79f4cfeff532119b9305539c99..5eb601cc1fa5f99b0914315948ea4adb5b89c9d0 100644 (file)
@@ -641,7 +641,11 @@ ply_event_loop_remove_source_node (ply_event_loop_t *loop,
 
                 status = epoll_ctl (loop->epoll_fd, EPOLL_CTL_DEL, source->fd, NULL);
 
-                if (status < 0)
+                /*
+                 * EBADF means that there was a disconnect handler, which has
+                 * closed the fd, which is fine, do not log an error for this.
+                 */
+                if (status < 0 && errno != EBADF)
                         ply_trace ("failed to delete fd %d from epoll watch list: %m", source->fd);
                 source->is_getting_polled = false;
         }