Commit 9f1cdbee authored by Tollef Fog Heen's avatar Tollef Fog Heen

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.
parent e60cfbcf
......@@ -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)
......
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment