bug-coreutils
[Top][All Lists]
Advanced

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

[PATCH] tail: don't give up on inotify mode for an already-ignored "-"


From: Jim Meyering
Subject: [PATCH] tail: don't give up on inotify mode for an already-ignored "-"
Date: Mon, 07 Sep 2009 21:02:15 +0200

My recent change in this area wasn't quite right.
For example, before,

  : > k; ./tail -f - k < .

would revert to sleep-based implementation.
With this patch, since "-" ends up being ignored, the inotify-based
implementation is used.


>From a8d26b3ce1630b6e9213b79d213ad7c699ee9861 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Mon, 7 Sep 2009 20:56:38 +0200
Subject: [PATCH] tail: don't give up on inotify mode for an already-ignored "-"

* src/tail.c (main): Adjust today's change to honor the
F[i].ignore flag that may have been set in tail_file.
---
 src/tail.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/tail.c b/src/tail.c
index c53df9e..9288007 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -1991,7 +1991,7 @@ main (int argc, char **argv)
       bool stdin_cmdline_arg = false;

       for (i = 0; i < n_files; i++)
-        if (STREQ (file[i], "-"))
+        if (!F[i].ignore && STREQ (F[i].name, "-"))
           stdin_cmdline_arg = true;

       if (!disable_inotify && !stdin_cmdline_arg)
--
1.6.4.2.419.gab238




reply via email to

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