From: Hans de Goede Date: Tue, 18 Feb 2020 20:16:38 +0000 (+0100) Subject: event-loop: Fix debug-log "failed to delete fd # from epoll watch list" spam X-Git-Tag: 0.9.5~17^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cf7658b4cd9e54813061011b959f272cef53e251;p=thirdparty%2Fplymouth.git event-loop: Fix debug-log "failed to delete fd # from epoll watch list" spam 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 --- diff --git a/src/libply/ply-event-loop.c b/src/libply/ply-event-loop.c index 0e8ad7c8..5eb601cc 100644 --- a/src/libply/ply-event-loop.c +++ b/src/libply/ply-event-loop.c @@ -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; }