coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [coreutils] [PATCH] tail: fix checking of currently unavailable dire


From: Pádraig Brady
Subject: Re: [coreutils] [PATCH] tail: fix checking of currently unavailable directories
Date: Tue, 12 Oct 2010 02:44:19 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

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

[Prev in Thread] Current Thread [Next in Thread]