diff options
author | Jim Meyering <jim@meyering.net> | 2005-10-24 16:07:36 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2005-10-24 16:07:36 +0000 |
commit | 91795f6fa29eac96e3a18d1c2198c66f3fca364a (patch) | |
tree | 19b919ae1d8f2e97e306eaff8f8b0c45bd6727f8 /src | |
parent | b9165cb37310af00f12be6b814dc97cd194c5107 (diff) | |
download | coreutils-91795f6fa29eac96e3a18d1c2198c66f3fca364a.tar.xz |
(tac_file): When determining whether a file is seekable,
also test whether it is a tty. Using only the lseek-based test would
give a false positive on Solaris. Reported by Peter Fales.
Diffstat (limited to 'src')
-rw-r--r-- | src/tac.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -547,9 +547,9 @@ tac_file (const char *filename) file_size = lseek (fd, (off_t) 0, SEEK_END); - ok = (0 <= file_size - ? tac_seekable (fd, filename) - : tac_nonseekable (fd, filename)); + ok = (file_size < 0 || isatty (fd) + ? tac_nonseekable (fd, filename) + : tac_seekable (fd, filename)); if (!is_stdin && close (fd) != 0) { |