* src/tail.c (check_output_available): Only check the returned events from poll() when it indicates there are events to check. --- src/tail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/tail.c b/src/tail.c index e2e7f4690..938bd3a73 100644 --- a/src/tail.c +++ b/src/tail.c @@ -369,7 +369,7 @@ check_output_alive (void) pfd.events = pfd.revents = 0; pfd.events |= POLLRDBAND; /* Needed for illumos, macos. */ - if (poll (&pfd, 1, 0) >= 0 && (pfd.revents & (POLLERR | POLLHUP))) + if (poll (&pfd, 1, 0) > 0 && (pfd.revents & (POLLERR | POLLHUP))) die_pipe (); #else struct timeval delay; -- 2.26.2