From 1a8a2d84cd3057f409a64626347b3ce7690c4334 Mon Sep 17 00:00:00 2001 From: eivind Date: Thu, 26 May 2005 22:14:37 +0000 Subject: We are past 4.4BSD - use our new-found stat flags for pipes and fifos. --- usr.bin/tail/tail.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'usr.bin/tail/tail.c') 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. */ } -- cgit v1.1