On 12/10/10 02:18, Pádraig Brady wrote:
> I'll apply the attached tomorrow at some stage.

With this squashed in to replace the confusing
"no space left on device" error, with the
"reverting to polling" information.
This has the side effect of tail-2/wait
passing on effected systems.

diff --git a/src/tail.c b/src/tail.c
index 14c17de..1fea8d1 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -1356,7 +1356,7 @@ tail_forever_inotify (int wd, struct File_spec *f, size_t 
n_files,

               f[i].name[dirlen] = prev;

-              if (f[i].parent_wd < 0)
+              if (f[i].parent_wd < 0 && errno != ENOSPC)
                 {
                   error (0, errno, _("cannot watch parent directory of %s"),
                          quote (f[i].name));
@@ -1371,7 +1371,7 @@ tail_forever_inotify (int wd, struct File_spec *f, size_t 
n_files,

           if (f[i].wd < 0)
             {
-              if (errno != f[i].errnum)
+              if (errno != f[i].errnum && errno != ENOSPC)
                 error (0, errno, _("cannot watch %s"), quote (f[i].name));
               no_inotify_resources |= (errno == ENOSPC);
               continue;
@@ -2175,6 +2175,9 @@ main (int argc, char **argv)

               if (!tail_forever_inotify (wd, F, n_files, sleep_interval))
                 exit (EXIT_FAILURE);
+              else
+                error (0, errno,
+                       _("inotify cannot be used, reverting to polling"));
             }
         }
 #endif



Reply via email to