summaryrefslogtreecommitdiff
path: root/src/kernel/handle.c
diff options
context:
space:
mode:
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) {