The tailf(1) never worked very well with block or character devices,
sockets, fifos and such. Now after mmap() is used to find last lines
even the little command used to work for example pipes is broken, so test
the tailf is asked to follow a file and when not fail. That said
symlinks are OK, as long they point to a file.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
if (stat(filename, &st) != 0)
err(EXIT_FAILURE, _("stat of %s failed"), filename);
-
+ if (!S_ISREG(st.st_mode))
+ errx(EXIT_FAILURE, _("%s: is not a file"), filename);
if (st.st_size)
tailf(filename, lines, &st);