summaryrefslogtreecommitdiff
path: root/src/user/app/ext2fs
diff options
context:
space:
mode:
authordzwdz2023-02-25 18:40:31 +0100
committerdzwdz2023-02-25 18:40:31 +0100
commitfc20b233a9fc6fa398ee046219c02ed6c15c442a (patch)
tree1d7d84fc69fcaaf9ce56a835cdb94222772696aa /src/user/app/ext2fs
parent1a1eb66fa0f4e6de6d06d80dae1bdce276fbd294 (diff)
user/ext2fs: don't treat EOF as an error
Diffstat (limited to 'src/user/app/ext2fs')
-rw-r--r--src/user/app/ext2fs/main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/user/app/ext2fs/main.c b/src/user/app/ext2fs/main.c
index 678d189..12ef3bc 100644
--- a/src/user/app/ext2fs/main.c
+++ b/src/user/app/ext2fs/main.c
@@ -115,9 +115,13 @@ do_read(struct ext2 *fs, hid_t reqh, struct ufs_request *req, char *buf, size_t
ext2_dropreq(fs, inode, false);
void *b = ext2_req_file(fs, h->n, &req->capacity, req->offset);
- if (!b) goto err;
- _sys_fs_respond(reqh, b, req->capacity, 0);
- ext2_dropreq(fs, b, false);
+ if (b) {
+ _sys_fs_respond(reqh, b, req->capacity, 0);
+ ext2_dropreq(fs, b, false);
+ } else if (req->capacity == 0) {
+ /* set by ext2_req_file on EOF */
+ _sys_fs_respond(reqh, b, 0, 0);
+ } else goto err;
} else {
struct dirbuild db;
char namebuf[257];