tail: fix --follow to not use inotify on remote files
commit8d2ecd4a3e30be880b2937bc1d76297a1c2e387a
authorPádraig Brady <P@draigBrady.com>
Mon, 14 Dec 2009 22:45:34 +0000 (14 22:45 +0000)
committerPádraig Brady <P@draigBrady.com>
Fri, 25 Dec 2009 00:56:41 +0000 (25 00:56 +0000)
treec5eab862b21df8caf952c33a7f3da45954b021a6
parent11dc0016bb72372bbd46b964fb57f4d10448225a
tail: fix --follow to not use inotify on remote files

* src/tail.c (struct File_spec): Add a flag to record if file is remote.
(recheck): If we're using inotify then check if the file has gone remote
and if so, drop it with a warning.
(any_remote_files): A new function to check for any open remote files.
(tailable_stdin): A new function to refactor the check for whether
a tailable file was specified through stdin.
(fremote): A new function to check if a file descriptor
refers to a remote file.
(tail_forever_inotify): Add some comments.
(tail_file): Record if a file is remote when initially opened.
(main): Disable inotify if any remote files specified.
Also document the caveat about remounted files not
being noticed by inotify.
* NEWS: Mention the fix.
NEWS
src/tail.c