[hackers] [sbase] tail: Ignore anything other than FIFOs and regular files for -f || sin

From: <git_AT_suckless.org>
Date: Tue, 24 Mar 2015 23:53:39 +0100 (CET)

commit 124cb7415a9a1a55f2dff5adc36a2e14f0392adc
Author: sin <sin_AT_2f30.org>
Date: Mon Feb 9 15:03:35 2015 +0000

    tail: Ignore anything other than FIFOs and regular files for -f

diff --git a/tail.c b/tail.c
index 11af1dd..e244930 100644
--- a/tail.c
+++ b/tail.c
_AT_@ -101,6 +101,8 @@ main(int argc, char *argv[])
                                        newline ? "\n" : "", argv[0]);
                         if (stat(argv[0], &st1) < 0)
                                 eprintf("stat %s:", argv[0]);
+ if (!(S_ISFIFO(st1.st_mode) || S_ISREG(st1.st_mode)))
+ fflag = 0;
                         newline = 1;
                         tail(fp, argv[0], n);
 
Received on Tue Mar 24 2015 - 23:53:39 CET

This archive was generated by hypermail 2.3.0 : Wed Mar 25 2015 - 00:08:28 CET