tail: improve inotify handling of symlinks
commitba6582e95ce2a041423e1ff34c93abe7b4702332
authorPádraig Brady <P@draigBrady.com>
Fri, 13 Sep 2013 15:31:24 +0000 (13 17:31 +0200)
committerPádraig Brady <P@draigBrady.com>
Wed, 27 Nov 2013 01:40:08 +0000 (27 01:40 +0000)
treeb9d30c8ff7fc2a00e80b12c5b7f15f318ec02b98
parent799e10f3619ea7949a4f606b2f29b662daf31e3c
tail: improve inotify handling of symlinks

Previous behavior failed to read contents of a (re)appearing file,
when symlinked by tail's watched file.  Also we now diagnose other
edge cases when running in inotify mode, where an initially
missing or regular file changes to a symlink.

* src/tail.c (main): If any arg is a symlink, use polling mode.
(recheck): Diagnose the edge case where a symlink appears during
inotify processing.
* tests/tail-2/symlink.sh: Test the fix. Mention the edge cases.
* tests/local.mk: Reference the new test.
* NEWS: Mention the fix.
Reported by: Ondrej Oprala
NEWS
src/tail.c
tests/local.mk
tests/tail-2/symlink.sh [new file with mode: 0755]