Comment, Jim?

From: dean gaudet <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: Bug#339400: Acknowledgement (tail -f broken on 2.4 kernel)
Date: Tue, 15 Nov 2005 18:03:19 -0800 (PST)

ugh this whole "blocking optimization" stuff in tail_forever just seems
broken... i'm not sure the correct fix, but the following fix seems to do
the job for me.

i've tested doing tail -f and -F on one and multiple files on 2.6 and 2.4
... i've done other nonsense tests like "tail -f" on stdin, and "cat |
tail -f" ... and they all appear to behave i'd expect them to.

-dean

--- coreutils-5.93/src/tail.c.orig      2005-11-02 05:18:47.000000000 -0800
+++ coreutils-5.93/src/tail.c   2005-11-15 17:58:55.852102952 -0800
@@ -1020,7 +1020,8 @@
              int new_flags = old_flags | (blocking ? 0 : O_NONBLOCK);
              if (old_flags < 0
                  || (new_flags != old_flags
-                     && fcntl (fd, F_SETFL, new_flags) == -1))
+                     && fcntl (fd, F_SETFL, new_flags) == -1
+                     && (!S_ISREG(f[i].mode) || errno != EPERM)))
                error (EXIT_FAILURE, errno,
                       _("%s: cannot change nonblocking mode"), name);
              f[i].blocking = blocking;






-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to