]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tail: fix recent ineffective AIX change
authorAyappan <ayappap2@in.ibm.com>
Sun, 20 Jan 2019 08:17:33 +0000 (00:17 -0800)
committerPádraig Brady <P@draigBrady.com>
Sun, 20 Jan 2019 08:45:32 +0000 (00:45 -0800)
* src/tail.c: Fix commit v8.30-40-gd5ab4cb which was ineffective.
Fixes http://bugs.gnu.org/33946

src/tail.c

index 9f5f44315a73386fc20eaec29789ddf7293d8fd6..c63b61631718f4814dd99748c8ac950d2a558ed4 100644 (file)
@@ -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