From b116c06e4d3609f07f1d9582a932ad3ea9ce7e15 Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Sat, 29 Aug 2015 14:21:27 +0300 Subject: [PATCH] ioloop-epoll: Fix fatal epoll_wait() error occurring when there are only ios with no fd. --- 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 bddb51ed92..9ccfeeaa4c 100644 --- a/src/lib/ioloop-epoll.c +++ b/src/lib/ioloop-epoll.c @@ -177,7 +177,7 @@ void io_loop_handler_run_internal(struct ioloop *ioloop) msecs = io_loop_get_wait_time(ioloop, &tv); events = array_get_modifiable(&ctx->events, &events_count); - if (ioloop->io_files != NULL) { + if (ioloop->io_files != NULL && events_count > ctx->deleted_count) { ret = epoll_wait(ctx->epfd, events, events_count, msecs); if (ret < 0 && errno != EINTR) i_fatal("epoll_wait(): %m"); -- 2.47.3