]> git.ipfire.org Git - thirdparty/coreutils.git/commit
tail -F: don't stop following the target of a rename
authorGiuseppe Scrivano <gscrivano@gnu.org>
Tue, 29 Dec 2009 23:20:24 +0000 (00:20 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 30 Dec 2009 10:22:55 +0000 (11:22 +0100)
commit2ead2365e01f8e103ddce6f34558eee3648de5b4
tree779b74a8a78a0616a47a44c4f3ed76530aa0a02e
parent2024418dc44d02e93c8a3aa0c63271f068a4ebe5
tail -F: don't stop following the target of a rename

This fixes a bug whereby tail -F would fail to track changes
to a file that was a target of a rename, and when the source of
the rename was another tailed file.

* src/tail.c (tail_forever_inotify): Ensure the wd is not already
present in the hash table before trying to add it.  When a new watch
descriptor is added to the `wd_to_name' hash table, check that it is
not already present.  If it is present then remove the previous element.
src/tail.c