summaryrefslogtreecommitdiff
path: root/src/tail.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2009-08-12 19:01:56 +0100
committerPádraig Brady <P@draigBrady.com>2009-08-13 16:09:27 +0100
commitf43f02865253e1cca210cc588269f5acf755259f (patch)
tree3daac617ab4bd074054442bbbdd3a9dad79d4dbc /src/tail.c
parente4caea57759495847dc52f7a7d062500dd711a96 (diff)
downloadcoreutils-f43f02865253e1cca210cc588269f5acf755259f.tar.xz
tail: fix tail -f failure when inotify used
* src/tail.c (tail_forever_inotify): Remove the redundant and incorrect error check of the return from inotify_add_watch(). Also initialize the wd member of each File_spec to an invalid value. Reported by C de-Avillez.
Diffstat (limited to 'src/tail.c')
-rw-r--r--src/tail.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/tail.c b/src/tail.c
index 3c8f425ca..6f8370625 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -1193,7 +1193,7 @@ tail_forever_inotify (int wd, struct File_spec *f, size_t n_files,
if (evlen < fnlen)
evlen = fnlen;
- f[i].wd = 0;
+ f[i].wd = -1;
if (follow_mode == Follow_name)
{
@@ -1231,8 +1231,7 @@ tail_forever_inotify (int wd, struct File_spec *f, size_t n_files,
if (hash_insert (wd_table, &(f[i])) == NULL)
xalloc_die ();
- if (follow_mode == Follow_name || f[i].wd)
- found_watchable = true;
+ found_watchable = true;
}
}