The problem happens only when we pipe the output of "tail -f" .
I am not sure how one can take the truss of "/tail -f test_file | grep 123" .
I did little debugging on the tail code. This function "check_output_alive" introduced by the commit (mentioned earlier in the thread) sents SIGPIPE after doing a select () call in AIX.
And that makes it exit immediately.
fd_set rfd;
FD_ZERO (&rfd);
FD_SET (STDOUT_FILENO, &rfd);
/* readable event on STDOUT is equivalent to POLLERR,
and implies an error condition on output like broken pipe. */
if (select (STDOUT_FILENO + 1, &rfd, NULL, NULL, &delay) == 1)
raise (SIGPIPE);
}
I didn't understand the real reason behind this commit.
Thanks
Ayappan PBernhard Voelker ---01/03/2019 11:53:17 PM---On 1/3/19 6:39 PM, Ayappan P2 wrote: >> On 01-Jan-2019, at 10:36 PM, Ayappan P2 <ayappap2@in.ibm.com
From: Bernhard Voelker <mail@bernhard-voelker.de>
To: Ayappan P2 <ayappap2@in.ibm.com>, 33946@debbugs.gnu.org
Date: 01/03/2019 11:53 PM
Subject: bug#33946: tail -f stops abruptly in AIX when piped.
Sent by: "Bug-coreutils" <bug-coreutils-bounces+ayappap2=in.ibm.com@gnu.org>