From: Rob Landley Date: Sat, 13 Aug 2005 00:35:00 +0000 (-0000) Subject: Very minor tweak to tail. X-Git-Tag: 1_1_0~826 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=58a651b2e59eaeeeb426a58bf8063f860044a2fa;p=oweals%2Fbusybox.git Very minor tweak to tail. --- 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;