Mailing List Archive

r918 - trunk/varnish-cache/bin/varnishd
Author: phk
Date: 2006-09-06 11:18:06 +0200 (Wed, 06 Sep 2006)
New Revision: 918

Modified:
trunk/varnish-cache/bin/varnishd/cache_acceptor_epoll.c
Log:
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 <xing at litespeedtech.com>


Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor_epoll.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_acceptor_epoll.c 2006-09-06 07:37:34 UTC (rev 917)
+++ trunk/varnish-cache/bin/varnishd/cache_acceptor_epoll.c 2006-09-06 09:18:06 UTC (rev 918)
@@ -37,7 +37,10 @@
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