mirror of
https://github.com/sheumann/hush.git
synced 2024-11-05 06:07:00 +00:00
Very minor tweak to tail.
This commit is contained in:
parent
f9bd87b0a7
commit
58a651b2e5
@ -85,10 +85,7 @@ static ssize_t tail_read(int fd, char *buf, size_t count)
|
|||||||
end = current = lseek(fd, 0, SEEK_CUR);
|
end = current = lseek(fd, 0, SEEK_CUR);
|
||||||
if (!fstat(fd, &sbuf))
|
if (!fstat(fd, &sbuf))
|
||||||
end = sbuf.st_size;
|
end = sbuf.st_size;
|
||||||
if (end < current)
|
lseek(fd, end < current ? 0 : current, SEEK_SET);
|
||||||
lseek(fd, 0, SEEK_SET);
|
|
||||||
else
|
|
||||||
lseek(fd, current, SEEK_SET);
|
|
||||||
if ((r = safe_read(fd, buf, count)) < 0) {
|
if ((r = safe_read(fd, buf, count)) < 0) {
|
||||||
bb_perror_msg("read");
|
bb_perror_msg("read");
|
||||||
status = EXIT_FAILURE;
|
status = EXIT_FAILURE;
|
||||||
|
Loading…
Reference in New Issue
Block a user