summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2001-09-19 10:28:09 +0000
committerJim Meyering <jim@meyering.net>2001-09-19 10:28:09 +0000
commitf3eff573fc54bf2e0ac65bfd4305711767947474 (patch)
tree86fc9ef04663d1706436641841d36d3bfbdc8d38 /src
parent18b2abbf6c741f61f4a22c31e21462a27263b4cb (diff)
downloadcoreutils-f3eff573fc54bf2e0ac65bfd4305711767947474.tar.xz
(open_next_file): Use SETVBUF, not setbuf.
(skip): Revert part of last change: use lseek, not fseek.
Diffstat (limited to 'src')
-rw-r--r--src/od.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/od.c b/src/od.c
index c0c4a0595..1bb0a720e 100644
--- a/src/od.c
+++ b/src/od.c
@@ -934,7 +934,7 @@ open_next_file (void)
while (in_stream == NULL);
if (limit_bytes_to_format && !flag_dump_strings)
- setbuf (in_stream, NULL);
+ SETVBUF (in_stream, NULL, _IONBF, 0);
SET_BINARY (fileno (in_stream));
return err;
@@ -1060,8 +1060,8 @@ skip (off_t n_skip)
/* If the number of bytes left to skip is less than the size
of the current file, try seeking to the correct offset. */
- else if (S_ISREG (file_stats.st_mode) &&
- fseek (in_stream, n_skip, SEEK_CUR) == 0)
+ else if (S_ISREG (file_stats.st_mode)
+ && 0 <= lseek (fileno (in_stream), n_skip, SEEK_CUR))
{
n_skip = 0;
}