coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tail: --pid option does not work when input is a FIFO


From: Bernhard Voelker
Subject: Re: tail: --pid option does not work when input is a FIFO
Date: Sat, 19 Oct 2024 09:48:20 +0200
User-agent: Mozilla Thunderbird

Hi Padraig,

On 10/18/24 14:50, Pádraig Brady wrote:
In my testing the initial open() of the fifo blocks,
before the -f loops are processed.
If the monitored file was written by another process,
this_does_  unblock things for me, and --pid is processed.

The attached patch avoids the blocking behavior with fifos,
and thus honors the --pid checking in parallel (and passes all tests).

Thanks, this solves the issue for my case:

  $ rm f; mkfifo f ; sleep 5 & timeout 10 ~/coreutils/src/tail -f --pid=$! f; 
echo $?
  [3] 1174778
  [3]+  Done                    sleep 5
  0

However I've only thought about this for a couple of minutes,
so need to consider all the implications.

I didn't have the time to check further either.

Have a nice day,
Berny



reply via email to

[Prev in Thread] Current Thread [Next in Thread]