]> git.ipfire.org Git - thirdparty/coreutils.git/commit
tail: ensure --follow=name unfollows renamed files
authorPádraig Brady <P@draigBrady.com>
Wed, 4 Dec 2024 19:40:55 +0000 (19:40 +0000)
committerPádraig Brady <P@draigBrady.com>
Thu, 5 Dec 2024 12:53:13 +0000 (12:53 +0000)
commitfd01fc8075a0df4e9036fdb962b589e60c134e26
tree47e96819971eb0783ea16693639c76120a89e32c
parentdf71ac83436e6876f098495ea58f0df9ee7c31cd
tail: ensure --follow=name unfollows renamed files

Require --retry to continue to track files upon rename.
We already unfollowed a file if it was renamed
to another file system (unlinked), so this makes the behavior
consistent if renaming to a file in the same file system.
I.e. --follow=name without --retry, means unfollow if the
name is unlinked or moved, so this change ensures that
behavior for all rename cases.
Related commits: v8.0-121-g3b997a9bcv8.23-161-gd313a0b24

* src/tail.c (tail_forever_notify): Remove watch for a renamed file
if --retry is not specified.
* tests/tail/F-vs-rename.sh: Related test cleanup.
* tests/tail/follow-name.sh: Add a test case.
* NEWS: Mention the bug fix.
Fixes https://bugs.gnu.org/74653
NEWS
src/tail.c
tests/tail/F-vs-rename.sh
tests/tail/follow-name.sh