summaryrefslogtreecommitdiffstats
path: root/usr.bin/tail
diff options
context:
space:
mode:
authoreivind <eivind@FreeBSD.org>2005-05-26 22:14:37 +0000
committereivind <eivind@FreeBSD.org>2005-05-26 22:14:37 +0000
commit1a8a2d84cd3057f409a64626347b3ce7690c4334 (patch)
tree20e2a2dd41e5598da88f1e9f1fca9b7f12e9e196 /usr.bin/tail
parent2754f60f30b22deaed5d84d6fa7d6d330f09757a (diff)
downloadFreeBSD-src-1a8a2d84cd3057f409a64626347b3ce7690c4334.zip
FreeBSD-src-1a8a2d84cd3057f409a64626347b3ce7690c4334.tar.gz
We are past 4.4BSD - use our new-found stat flags for pipes and fifos.
Diffstat (limited to 'usr.bin/tail')
-rw-r--r--usr.bin/tail/tail.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/usr.bin/tail/tail.c b/usr.bin/tail/tail.c
index 9162d17..373e6e2 100644
--- a/usr.bin/tail/tail.c
+++ b/usr.bin/tail/tail.c
@@ -219,12 +219,7 @@ main(int argc, char *argv[])
exit(1);
}
- /*
- * Determine if input is a pipe. 4.4BSD will set the SOCKET
- * bit in the st_mode field for pipes. Fix this then.
- */
- if (lseek(fileno(stdin), (off_t)0, SEEK_CUR) == -1 &&
- errno == ESPIPE) {
+ if ((sb.st_mode & S_IFMT) == S_IFSOCK || (sb.st_mode & S_IFMT) == S_IFIFO) {
errno = 0;
fflag = 0; /* POSIX.2 requires this. */
}
OpenPOWER on IntegriCloud