]> git.ipfire.org Git - thirdparty/coreutils.git/commit
tail: fix race between read and fstat
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 3 Aug 2025 15:19:53 +0000 (08:19 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Aug 2025 02:48:06 +0000 (19:48 -0700)
commite0100ac746e6ddefeef09e17716c148edc1f995b
tree6017ca72fd3ec4f48bb5cf8bd58874c51e930556
parent3655a8ccede900666fbe4be2520358eb4ebc8cb9
tail: fix race between read and fstat

* src/tail.c (get_file_status): Remove, since after the changes
described below it would be called in just one place and it’s a
bit clearer to inline by hand.
(tail_file): Don’t call fstat after reading the file, as that
misses changes arriving between read and fstat.  Instead, reuse
the fstat done before reading the file.
src/tail.c