From 66a0e19f74f65eceda662dcf6533eaae170eb303 Mon Sep 17 00:00:00 2001 From: phk Date: Wed, 2 Aug 2006 18:17:49 +0000 Subject: [PATCH] Allow ENOENT on removing kqueue events, a close will have drained them already. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@609 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_acceptor.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/cache_acceptor.c b/varnish-cache/bin/varnishd/cache_acceptor.c index 272a1cff..9d35285c 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor.c +++ b/varnish-cache/bin/varnishd/cache_acceptor.c @@ -261,13 +261,18 @@ static void vca_kq_sess(struct sess *sp, int arm) { struct kevent ke[2]; + int i; assert(arm == EV_ADD || arm == EV_DELETE); CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); memset(ke, 0, sizeof ke); EV_SET(&ke[0], sp->fd, EVFILT_READ, arm, 0, 0, sp); EV_SET(&ke[1], sp->fd, EVFILT_TIMER, arm , 0, 5000, sp); - AZ(kevent(kq, ke, 2, NULL, 0, NULL)); + i = kevent(kq, ke, 2, NULL, 0, NULL); + if (arm == EV_ADD) + assert(i == 0); + else + assert(i == 0 || errno == ENOENT); } static void -- 2.39.5