summaryrefslogtreecommitdiff
path: root/src/kernel/handle.c
diff options
context:
space:
mode:
authordzwdz2024-05-11 22:05:04 +0200
committerdzwdz2024-05-11 22:05:04 +0200
commit15e02a470652a5d4ef87485b5ae12afc06dc53f8 (patch)
treee27e410885abe69d4fd20211a27e0196392993a4 /src/kernel/handle.c
parentec3d2400db15e6911138d88f95cae141a9da2130 (diff)
kernel: DUP_RDONLY and DUP_WRONLY
I probably should've tested DUP_WRONLY too, now that I think about it. TODO?
Diffstat (limited to 'src/kernel/handle.c')
-rw-r--r--src/kernel/handle.c6
1 files changed, 5 insertions, 1 deletions
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) {