r609 - trunk/varnish-cache/bin/varnishd
phk at projects.linpro.no
phk at projects.linpro.no
Wed Aug 2 20:17:49 CEST 2006
Author: phk
Date: 2006-08-02 20:17:49 +0200 (Wed, 02 Aug 2006)
New Revision: 609
Modified:
trunk/varnish-cache/bin/varnishd/cache_acceptor.c
Log:
Allow ENOENT on removing kqueue events, a close will have drained
them already.
Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_acceptor.c 2006-08-02 18:12:42 UTC (rev 608)
+++ trunk/varnish-cache/bin/varnishd/cache_acceptor.c 2006-08-02 18:17:49 UTC (rev 609)
@@ -261,13 +261,18 @@
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
More information about the varnish-commit
mailing list