From 211e7bc888ee52f0e9c31603d9c05148ed723303 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 8 Mar 2019 12:34:29 +0200 Subject: [PATCH] lib: Panic on most epoll_ctl() failures Anything except ENOSPC or ENOMEM points to a bug in code. Getting core dump from those helps debugging. --- src/lib/ioloop-epoll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ioloop-epoll.c b/src/lib/ioloop-epoll.c index 9d1868e87c..34e4098cae 100644 --- a/src/lib/ioloop-epoll.c +++ b/src/lib/ioloop-epoll.c @@ -145,7 +145,7 @@ void io_loop_handle_remove(struct io_file *io, bool closed) const char *errstr = t_strdup_printf( "epoll_ctl(%s, %d) failed: %m", op == EPOLL_CTL_DEL ? "del" : "mod", io->fd); - if (errno == EBADF) + if (errno != ENOSPC && errno != ENOMEM) i_panic("%s", errstr); else i_error("%s", errstr);