tail: support rechecking currently missing remote dirs
authorPádraig Brady <P@draigBrady.com>
Sun, 24 Oct 2010 13:02:12 +0000 (14:02 +0100)
committerPádraig Brady <P@draigBrady.com>
Mon, 25 Oct 2010 14:41:53 +0000 (15:41 +0100)
src/tail.c (main): As an optimization, don't bother checking
for stdin or remote files, when ---disable-inotify is specified.
To improve the fix in commit 61b77891, set the disable_inotify
flag when we fall back to polling, so that we recheck remote files.
NEWS: Mention the fix

NEWS
src/tail.c

diff --git a/NEWS b/NEWS
index f28c243..7dbbf1f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,11 @@ GNU coreutils NEWS                                    -*- outline -*-
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
+** Bug fixes
+
+  tail -F once again notices changes in a currently unavailable
+  remote directory [bug introduced in coreutils-7.5]
+
 
 * Noteworthy changes in release 8.6 (2010-10-15) [stable]
 
index 68cc819..9242210 100644 (file)
@@ -2169,7 +2169,8 @@ main (int argc, char **argv)
          FIXME: when using inotify, and a directory for a watched file
          is recreated, then we don't recheck any new file when
          follow_mode == Follow_name  */
-      if (tailable_stdin (F, n_files) || any_remote_file (F, n_files))
+      if (!disable_inotify && (tailable_stdin (F, n_files)
+                               || any_remote_file (F, n_files)))
         disable_inotify = true;
 
       if (!disable_inotify)
@@ -2189,6 +2190,7 @@ main (int argc, char **argv)
           error (0, errno, _("inotify cannot be used, reverting to polling"));
         }
 #endif
+      disable_inotify = true;
       tail_forever (F, n_files, sleep_interval);
     }