From: phk Date: Sun, 30 Sep 2007 19:42:08 +0000 (+0000) Subject: Set the poll'ed fd to -1 when we halfclose the fd to avoid X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e95561fcf54591e1dfeb9da75d2b228db70519a;p=varnish Set the poll'ed fd to -1 when we halfclose the fd to avoid an infinite loop on certain OS's. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2057 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_pipe.c b/varnish-cache/bin/varnishd/cache_pipe.c index 3e6392ec..4df0a0c2 100644 --- a/varnish-cache/bin/varnishd/cache_pipe.c +++ b/varnish-cache/bin/varnishd/cache_pipe.c @@ -52,6 +52,7 @@ rdf(struct pollfd *fds, int idx) if (i <= 0 || fds[1-idx].events == 0) { AZ(shutdown(fds[idx].fd, SHUT_RD)); AZ(shutdown(fds[1-idx].fd, SHUT_WR)); + fds[idx].fd = -1; fds[idx].events = 0; return; } @@ -60,6 +61,7 @@ rdf(struct pollfd *fds, int idx) if (j != i) { AZ(shutdown(fds[idx].fd, SHUT_WR)); AZ(shutdown(fds[1-idx].fd, SHUT_RD)); + fds[1-idx].fd = -1; fds[1-idx].events = 0; return; }