From 115ba7e0830a00a7b0bce5887c8ffeba78e3ab53 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 9 Jun 2023 13:53:53 +0200 Subject: libio: remove eof flag from istream_t interface Signed-off-by: David Oberhollenzer --- lib/io/src/unix/istream.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/io/src/unix') diff --git a/lib/io/src/unix/istream.c b/lib/io/src/unix/istream.c index db870d9..8a2dc26 100644 --- a/lib/io/src/unix/istream.c +++ b/lib/io/src/unix/istream.c @@ -11,6 +11,7 @@ typedef struct { char *path; int fd; + bool eof; sqfs_u8 buffer[BUFSZ]; } file_istream_t; @@ -29,12 +30,12 @@ static int file_precache(istream_t *strm) strm->buffer = file->buffer; - while (!strm->eof && strm->buffer_used < BUFSZ) { + while (!file->eof && strm->buffer_used < BUFSZ) { ssize_t ret = read(file->fd, file->buffer + strm->buffer_used, BUFSZ - strm->buffer_used); if (ret == 0) - strm->eof = true; + file->eof = true; if (ret < 0) { if (errno == EINTR) -- cgit v1.2.3