Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2005-08-13 04:35:00 +0400
committerRob Landley <rob@landley.net>2005-08-13 04:35:00 +0400
commit58a651b2e59eaeeeb426a58bf8063f860044a2fa (patch)
tree16186cd4867e24066410a1242c70e6ec09fdf3fd /coreutils/tail.c
parentf9bd87b0a73db17c7f8dadb05167f6342766b485 (diff)
Very minor tweak to tail.
Diffstat (limited to 'coreutils/tail.c')
-rw-r--r--coreutils/tail.c5
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)
end = current = lseek(fd, 0, SEEK_CUR);
if (!fstat(fd, &sbuf))
end = sbuf.st_size;
- if (end < current)
- lseek(fd, 0, SEEK_SET);
- else
- lseek(fd, current, SEEK_SET);
+ lseek(fd, end < current ? 0 : current, SEEK_SET);
if ((r = safe_read(fd, buf, count)) < 0) {
bb_perror_msg("read");
status = EXIT_FAILURE;