]> git.ipfire.org Git - thirdparty/coreutils.git/commit
tail: track errno more accurately
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Aug 2025 23:55:09 +0000 (16:55 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Aug 2025 02:48:06 +0000 (19:48 -0700)
commit3655a8ccede900666fbe4be2520358eb4ebc8cb9
tree08a4d20d20dde44f01c6c9fa1d8720105a101be8
parent0b2080f2fad8a0971e28e2b43fcf878d17e8e30b
tail: track errno more accurately

This matters only in some obscure cases hard to test for.
* src/tail.c (file_lines, pipe_lines, pipe_bytes, start_bytes)
(start_lines, tail_bytes, tail_lines, tail): New return
convention, which reports errno.  All callers changed.
(recheck): Don’t lose track of errno if a regular file is
replaced by a symlink.
(get_file_status): Set errno to 0 on success.
(tail_file): Be more careful about f->errnum.
It is now -1 only if the failure was not due to
a system call failing.
src/tail.c