From 0fc9b2dfd8cb4a1bbc9698a6df2516bdd2084384 Mon Sep 17 00:00:00 2001 From: phk Date: Wed, 6 Sep 2006 09:18:06 +0000 Subject: [PATCH] Fix the same issue as in the kqueue acceptor: By the time we get here the filedescriptor may already be closed, so accept EBADF. Reported by: Xing Li git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@918 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_acceptor_epoll.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/cache_acceptor_epoll.c b/varnish-cache/bin/varnishd/cache_acceptor_epoll.c index e7de8676..39ae6389 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor_epoll.c +++ b/varnish-cache/bin/varnishd/cache_acceptor_epoll.c @@ -37,7 +37,10 @@ vca_add(int fd, void *data) static void vca_del(int fd) { - AZ(epoll_ctl(epfd, EPOLL_CTL_DEL, fd, NULL)); + int i; + + i = epoll_ctl(epfd, EPOLL_CTL_DEL, fd, NULL); + assert(i == 0 || errno == EBADF); } static void -- 2.39.5