From 15e02a470652a5d4ef87485b5ae12afc06dc53f8 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 11 May 2024 22:05:04 +0200 Subject: kernel: DUP_RDONLY and DUP_WRONLY I probably should've tested DUP_WRONLY too, now that I think about it. TODO? --- src/kernel/handle.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/kernel/handle.c') diff --git a/src/kernel/handle.c b/src/kernel/handle.c index ca4c4c4..882a4fa 100644 --- a/src/kernel/handle.c +++ b/src/kernel/handle.c @@ -19,12 +19,16 @@ void handle_close(Handle *h) { if (--(h->refcount) > 0) return; if (h->type == HANDLE_FILE) { - vfsreq_create((VfsReq) { + if (h->base) { + handle_close(h->base); + } else { + vfsreq_create((VfsReq) { .type = VFSOP_CLOSE, .id = h->file_id, .caller = NULL, .backend = h->backend, }); + } } else if (h->type == HANDLE_PIPE) { assert(!h->pipe.queued); if (h->pipe.sister) { -- cgit v1.2.3