mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
tail: refactor to skip stat call on failure
* src/tail.c (tail_bytes): New function. (tail_bytes, tail_lines, tail): Accept struct stat pointer from caller instead of calling fstat ourselves. All callers changed. (tail_file): Skip a call to fstat if fstat already failed. * tests/tail/follow-stdin.sh: Adjust to match new behavior on failure, which omits a redundant diagnostic.
This commit is contained in:
@@ -59,7 +59,6 @@ done
|
||||
returns_ 1 timeout 10 tail -f - <&- 2>errt || fail=1
|
||||
cat <<\EOF >exp || framework_failure_
|
||||
tail: cannot fstat 'standard input'
|
||||
tail: error reading 'standard input'
|
||||
tail: no files remaining
|
||||
EOF
|
||||
sed 's/\(tail:.*\):.*/\1/' errt > err || framework_failure_
|
||||
|
||||
Reference in New Issue
Block a user