]> git.ipfire.org Git - thirdparty/coreutils.git/commit
tail: revert to polling if a followed directory is replaced
authorSebastian Kisela <skisela@redhat.com>
Wed, 5 Apr 2017 07:40:41 +0000 (09:40 +0200)
committerPádraig Brady <P@draigBrady.com>
Thu, 6 Apr 2017 00:45:17 +0000 (17:45 -0700)
commitba5fe2d4b8b6a8366f48b1ad1f97fe26c9089b53
tree5036db7cb2b0d22d2d1f51c743edfaf09714d619
parent2c622e11f47a03143ebeeb93a2b7e8189c440499
tail: revert to polling if a followed directory is replaced

* src/tail.c (tail_forever_inotify): Add the IN_DELETE_SELF flag when
creating watch for the parent directory.  After the parent directory
is removed, an event is caught and then we switch from inotify to
polling mode.  Till now, inotify has always frozen because it waited for
an event from a watched dir, which has been already deleted and was not
added again.
* tests/tail-2/inotify-dir-recreate.sh: Add a test case.
* tests/local.mk: Reference the new test.
* NEWS: Mention the bug fix.
Fixes http://bugs.gnu.org/26363
Reported at https://bugzilla.redhat.com/1283760
NEWS
src/tail.c
tests/local.mk
tests/tail-2/inotify-dir-recreate.sh [new file with mode: 0755]