diff options
author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-08-13 00:35:00 +0000 |
---|---|---|
committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-08-13 00:35:00 +0000 |
commit | 68fab5fae0242ac85e4407686f76fcb468628da9 (patch) | |
tree | 16186cd4867e24066410a1242c70e6ec09fdf3fd /coreutils/tail.c | |
parent | 792d88a64e578fd01090cf03e01f16e87c0d837e (diff) | |
download | busybox-w32-68fab5fae0242ac85e4407686f76fcb468628da9.tar.gz busybox-w32-68fab5fae0242ac85e4407686f76fcb468628da9.tar.bz2 busybox-w32-68fab5fae0242ac85e4407686f76fcb468628da9.zip |
Very minor tweak to tail.
git-svn-id: svn://busybox.net/trunk/busybox@11128 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to '')
-rw-r--r-- | coreutils/tail.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/coreutils/tail.c b/coreutils/tail.c index f330ab1a1..1db1e2b0f 100644 --- a/coreutils/tail.c +++ b/coreutils/tail.c | |||
@@ -85,10 +85,7 @@ static ssize_t tail_read(int fd, char *buf, size_t count) | |||
85 | end = current = lseek(fd, 0, SEEK_CUR); | 85 | end = current = lseek(fd, 0, SEEK_CUR); |
86 | if (!fstat(fd, &sbuf)) | 86 | if (!fstat(fd, &sbuf)) |
87 | end = sbuf.st_size; | 87 | end = sbuf.st_size; |
88 | if (end < current) | 88 | lseek(fd, end < current ? 0 : current, SEEK_SET); |
89 | lseek(fd, 0, SEEK_SET); | ||
90 | else | ||
91 | lseek(fd, current, SEEK_SET); | ||
92 | if ((r = safe_read(fd, buf, count)) < 0) { | 89 | if ((r = safe_read(fd, buf, count)) < 0) { |
93 | bb_perror_msg("read"); | 90 | bb_perror_msg("read"); |
94 | status = EXIT_FAILURE; | 91 | status = EXIT_FAILURE; |