GNU bug report logs -
#24903
"tail -f - foo" does not terminate when stdin is closed and foo is ignored
Previous Next
Full log
Message #16 received at 24903 <at> debbugs.gnu.org (full text, mbox):
On 08/11/16 21:28, Bernhard Voelker wrote:
> On 11/08/2016 06:47 PM, Pádraig Brady wrote:
>> Subject: [PATCH] tail: terminate when following pipes and untailable non pipes
>>
>> * src/tail.c (ignore_pipe_or_fifo): Mark the descriptor as -1
>> for pipes so that any_live_files() detects correctly that
>> the entry is no longer live.
>> * tests/tail-2/pipe-f.sh: Add a test case.
>> Fixes http://bugs.gnu.org/24903 which was detected
>> using Symbolic Execution techniques developed in
>> the course of the SYMBIOSYS research project at
>> COMSYS, RWTH Aachen University.
>
> The patch looks good, yet I think it warrants a NEWS entry.
Oops. I've added:
+ tail -f - 'untailable file' will now terminate when there is no more data
+ to read from stdin. Previously it behaved as if --retry was specified.
+ [This bug was present in "the beginning".]
BTW I see a related issue with `tail -f missing_file existing_file`.
Currently it will keep trying to open("missing_file") even though
--retry is not specified. That seems inconsistent to me.
Shouldn't we ignore items that fail the initial open()?
I'll do another fix for that unless there are objections.
cheers,
Pádraig.
This bug report was last modified 8 years and 185 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.