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

This commit is contained in:
sin 2015-02-09 15:03:35 +00:00
parent a25a57f6ac
commit 124cb7415a
1 changed files with 2 additions and 0 deletions

2
tail.c
View File

@ -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);