From: Ayappan Date: Sun, 20 Jan 2019 08:17:33 +0000 (-0800) Subject: tail: fix recent ineffective AIX change X-Git-Tag: v8.31~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17983b2cb3bccbb4fa69691178caddd99269bda9;p=thirdparty%2Fcoreutils.git tail: fix recent ineffective AIX change * src/tail.c: Fix commit v8.30-40-gd5ab4cb which was ineffective. Fixes http://bugs.gnu.org/33946 --- diff --git a/src/tail.c b/src/tail.c index 9f5f44315a..c63b616317 100644 --- a/src/tail.c +++ b/src/tail.c @@ -339,6 +339,9 @@ named file in a way that accommodates renaming, removal and creation.\n\ static void check_output_alive (void) { + if (! monitor_output) + return; + #ifdef _AIX /* select on AIX was seen to give a readable event immediately. */ struct pollfd pfd; @@ -347,11 +350,7 @@ check_output_alive (void) if (poll (&pfd, 1, 0) >= 0 && (pfd.revents & POLLERR)) raise (SIGPIPE); -#endif - - if (! monitor_output) - return; - +#else struct timeval delay; delay.tv_sec = delay.tv_usec = 0; @@ -363,6 +362,7 @@ check_output_alive (void) and implies an error condition on output like broken pipe. */ if (select (STDOUT_FILENO + 1, &rfd, NULL, NULL, &delay) == 1) raise (SIGPIPE); +#endif } static bool