[experimental-ims] c4a27e7 Work around a bug in OSX

Geoff Simmons geoff at varnish-cache.org
Mon Jan 9 21:51:57 CET 2012


commit c4a27e7243249f33aeaf84ded84b007c145eaee8
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Sep 20 08:03:03 2011 +0000

    Work around a bug in OSX

diff --git a/bin/varnishtest/vtc_varnish.c b/bin/varnishtest/vtc_varnish.c
index c53482e..2ebef93 100644
--- a/bin/varnishtest/vtc_varnish.c
+++ b/bin/varnishtest/vtc_varnish.c
@@ -353,7 +353,15 @@ varnish_launch(struct varnish *v)
 	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
 	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