summaryrefslogtreecommitdiff
path: root/src/kernel/handle.c
diff options
context:
space:
mode:
authordzwdz2024-07-11 21:43:50 +0200
committerdzwdz2024-07-11 21:43:50 +0200
commited8ff1ff9c4c0f847ffc2ab4624bd999539a0890 (patch)
tree7dd5ad530f65fb09f6f0ce6c4d94efa2fc2d05d7 /src/kernel/handle.c
parent8138ba97608ff0cd4e443994390f277eca3d7b28 (diff)
kernel: start cleaning up VfsRequest
* I'm being more strict about the linked list state to hopefully ensure I'm not leaking any references. * vfsreq_create was renamed to vfsreq_dispatchcopy as that name feels more clear. It copies its argument, and dispatches it. * Requests for user backends are now handled more like requests for kernel backends - there's an accept() function that accepts a request.
Diffstat (limited to 'src/kernel/handle.c')
-rw-r--r--src/kernel/handle.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/kernel/handle.c b/src/kernel/handle.c
index f216c13..06a810c 100644
--- a/src/kernel/handle.c
+++ b/src/kernel/handle.c
@@ -1,3 +1,4 @@
+#include <camellia/errno.h>
#include <kernel/handle.h>
#include <kernel/malloc.h>
#include <kernel/panic.h>
@@ -22,7 +23,7 @@ void handle_close(Handle *h) {
if (h->base) {
handle_close(h->base);
} else {
- vfsreq_create((VfsReq) {
+ vfsreq_dispatchcopy((VfsReq) {
.type = VFSOP_CLOSE,
.id = h->file_id,
.caller = NULL,
@@ -36,7 +37,7 @@ void handle_close(Handle *h) {
h->pipe.sister->pipe.sister = NULL;
}
} else if (h->type == HANDLE_FS_REQ) {
- if (h->req) vfsreq_finish_short(h->req, -1);
+ if (h->req) vfsreq_finish_short(h->req, -EPIPE);
}
if (h->backend) {