summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/request.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/vfs/request.c')
-rw-r--r--src/kernel/vfs/request.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/kernel/vfs/request.c b/src/kernel/vfs/request.c
index b3769cf..5ee1678 100644
--- a/src/kernel/vfs/request.c
+++ b/src/kernel/vfs/request.c
@@ -75,16 +75,14 @@ int vfs_request_finish(struct vfs_request *req, int ret) {
// open() calls need special handling
// we need to wrap the id returned by the VFS in a handle passed to
// the client
- handle_t handle = process_find_handle(req->caller);
+ handle_t handle = process_find_handle(req->caller, 0);
if (handle < 0)
panic_invalid_state(); // we check for free handles before the open() call
- req->caller->handles[handle] = (struct handle){
- .type = HANDLE_FILE,
- .file = {
- .backend = req->backend,
- .id = ret,
- },
- };
+
+ struct handle *backing = handle_init(HANDLE_FILE);
+ backing->file.backend = req->backend;
+ backing->file.id = ret;
+ req->caller->handles[handle] = backing;
ret = handle;
}