summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-01-24 09:37:10 +0100
committerJim Meyering <meyering@redhat.com>2011-01-24 10:02:19 +0100
commit8264fc615a1beb82e062949e5cf17c852fcfaaaf (patch)
tree248652756c10e04341753077828b39640acf48fe
parent4afbba7bac2c292e982978a0744f153375c1e18e (diff)
downloadcoreutils-8264fc615a1beb82e062949e5cf17c852fcfaaaf.tar.xz
tail: avoid new diagnostic when applying -f to a pipe on linux-2.3.38
* src/tail.c (fremote): Do not print a diagnostic when fstatfs (pipe_FD, &buf) fails, as it now does on linux-2.3.38. This avoids the spurious failure of tests/misc/tail's f-pipe-1 test, when running in input-from-pipe mode.
-rw-r--r--src/tail.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tail.c b/src/tail.c
index 9682a537c..bcd2d9970 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -887,8 +887,11 @@ fremote (int fd, const char *name)
int err = fstatfs (fd, &buf);
if (err != 0)
{
- error (0, errno, _("cannot determine location of %s. "
- "reverting to polling"), quote (name));
+ /* On at least linux-2.6.38, fstatfs fails with ENOSYS when FD
+ is open on a pipe. Treat that like a remote file. */
+ if (errno != ENOSYS)
+ error (0, errno, _("cannot determine location of %s. "
+ "reverting to polling"), quote (name));
}
else
{