[master] 9f1cdbe Don't put POLLHUP in .events
Tollef Fog Heen
tfheen at varnish-cache.org
Wed Oct 10 13:55:29 CEST 2012
commit 9f1cdbeeb5b0bcefb57ed87a4ac7322537b861d0
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date: Tue Oct 2 08:38:49 2012 +0200
Don't put POLLHUP in .events
POLLHUP is always checked for, and is output-only on Linux and OSX, so
avoid putting it in the list of events we check for.
diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c
index 0678efd..4f084ad 100644
--- a/bin/varnishtest/vtc_http.c
+++ b/bin/varnishtest/vtc_http.c
@@ -1043,7 +1043,7 @@ cmd_http_expect_close(CMD_ARGS)
vtc_log(vl, 4, "Expecting close (fd = %d)", hp->fd);
while (1) {
fds[0].fd = hp->fd;
- fds[0].events = POLLIN | POLLHUP | POLLERR;
+ fds[0].events = POLLIN | POLLERR;
fds[0].revents = 0;
i = poll(fds, 1, 1000);
if (i == 0)
diff --git a/bin/varnishtest/vtc_varnish.c b/bin/varnishtest/vtc_varnish.c
index 0036720..794080f 100644
--- a/bin/varnishtest/vtc_varnish.c
+++ b/bin/varnishtest/vtc_varnish.c
@@ -395,16 +395,8 @@ varnish_launch(struct varnish *v)
fd[0].fd = v->cli_fd;
fd[0].events = POLLIN;
fd[1].fd = v->fds[0];
- fd[1].events = POLLHUP;
-#ifdef __APPLE__
- /*
- * OSX cannot poll a pipe for POLLHUP only, poll just returns
- * zero with no revents.
- */
- i = poll(fd, 1, 10000);
-#else
+ fd[1].events = 0; /* Only care about POLLHUP, which is output-only */
i = poll(fd, 2, 10000);
-#endif
vtc_log(v->vl, 4, "CLIPOLL %d 0x%x 0x%x",
i, fd[0].revents, fd[1].revents);
if (i == 0) {
More information about the varnish-commit
mailing list