coreutils
coreutils copied to clipboard
tail: -f and -F stall on a read when a FIFO writer connects and stays silent
Follow-up to #15769 and #16208.
#16208 stops the blocking open() of a followed name that was replaced by a FIFO. The read side has a similar case that is not covered: when a writer opens the FIFO and then sends nothing, the descriptor is in blocking mode and the read in tail_file waits on the single thread that serves all followed files. Output for the other files stops until the writer sends data or closes the FIFO.
Expected: like GNU tail, keep printing the other files. GNU reads such a FIFO without blocking.
A possible direction: keep O_NONBLOCK on followed FIFOs and treat WouldBlock from the read as "no new data".