This patch makes tail check the return value of the second lseek in tail_lines so that it works properly with /proc files on Linux. -- Debian GNU/Linux 2.2 is out! ( http://www.debian.org/ ) Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--- src/tail.c.orig Sun Sep 30 21:26:52 2001 +++ src/tail.c Tue Nov 13 18:34:06 2001 @@ -1088,9 +1088,9 @@ file_lines. file_lines shouldn't presume that the input file pointer is initially positioned to beginning of file. */ if (S_ISREG (stats.st_mode) - && lseek (fd, (off_t) 0, SEEK_CUR) == (off_t) 0) + && lseek (fd, (off_t) 0, SEEK_CUR) == (off_t) 0 + && (length = lseek (fd, (off_t) 0, SEEK_END)) >= 0) { - length = lseek (fd, (off_t) 0, SEEK_END); if (length != 0 && file_lines (pretty_filename, fd, n_lines, length)) return 1; }