[3.0] f8464b2 Don't put POLLHUP in .events

Tollef Fog Heen tfheen at varnish-cache.org
Mon Apr 22 13:27:00 CEST 2013


commit f8464b26060f91a91fbb5ec153d6326b01ae617c
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 cb58704..5a947f1 100644
--- a/bin/varnishtest/vtc_http.c
+++ b/bin/varnishtest/vtc_http.c
@@ -1049,7 +1049,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 e97fab2..56db682 100644
--- a/bin/varnishtest/vtc_varnish.c
+++ b/bin/varnishtest/vtc_varnish.c
@@ -408,7 +408,7 @@ 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;
+	fd[1].events = 0; /* Only care about POLLHUP, which is output-only */
 	i = poll(fd, 2, 10000);
 	vtc_log(v->vl, 4, "CLIPOLL %d 0x%x 0x%x",
 	    i, fd[0].revents, fd[1].revents);



More information about the varnish-commit mailing list