diff options
author | eivind <eivind@FreeBSD.org> | 2005-06-01 20:34:06 +0000 |
---|---|---|
committer | eivind <eivind@FreeBSD.org> | 2005-06-01 20:34:06 +0000 |
commit | 4587fc275c58e748bcd2067eed3c716c7c7ca467 (patch) | |
tree | fd4bf4901603b8b0bf7a5f6c099d6d732a941575 /usr.bin/tail | |
parent | 785e5d3c15efb2982814d6d7a8b103bc3ff1e9e7 (diff) | |
download | FreeBSD-src-4587fc275c58e748bcd2067eed3c716c7c7ca467.zip FreeBSD-src-4587fc275c58e748bcd2067eed3c716c7c7ca467.tar.gz |
Back out revision 1.19 and 1.20 until I find mental clarity to deal with
issues bde pointed out.
Diffstat (limited to 'usr.bin/tail')
-rw-r--r-- | usr.bin/tail/tail.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/tail/tail.c b/usr.bin/tail/tail.c index fa1e8f6..9162d17 100644 --- a/usr.bin/tail/tail.c +++ b/usr.bin/tail/tail.c @@ -219,7 +219,13 @@ main(int argc, char *argv[]) exit(1); } - if ((sb.st_mode & S_IFMT) == S_IFSOCK || (sb.st_mode & S_IFMT) == S_IFIFO) { + /* + * 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) { + errno = 0; fflag = 0; /* POSIX.2 requires this. */ } |