aboutsummaryrefslogtreecommitdiff
path: root/lib/io/src/unix/istream.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/io/src/unix/istream.c')
-rw-r--r--lib/io/src/unix/istream.c5
1 files changed, 3 insertions, 2 deletions
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)