summaryrefslogtreecommitdiff
path: root/src/kernel/handle.c
diff options
context:
space:
mode:
authordzwdz2022-07-05 22:51:21 +0200
committerdzwdz2022-07-05 22:51:21 +0200
commita89984d7200381d7b8035c48124d93105d59cf24 (patch)
tree01e788518dca3c5cdb269e82b6a272612ab51970 /src/kernel/handle.c
parentb16ab3edc8d3f3d5bcbe0afc8dec3e9ed822a224 (diff)
kernel: initial partial pipe support
Diffstat (limited to 'src/kernel/handle.c')
-rw-r--r--src/kernel/handle.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/kernel/handle.c b/src/kernel/handle.c
index ac8db1f..70830ff 100644
--- a/src/kernel/handle.c
+++ b/src/kernel/handle.c
@@ -3,9 +3,11 @@
#include <kernel/panic.h>
#include <kernel/proc.h>
#include <kernel/vfs/request.h>
+#include <shared/mem.h>
struct handle *handle_init(enum handle_type type) {
struct handle *h = kmalloc(sizeof *h);
+ memset(h, 0, sizeof *h);
h->type = type;
h->refcount = 1;
return h;
@@ -25,7 +27,8 @@ void handle_close(struct handle *h) {
});
}
- vfs_backend_refdown(h->backend);
+ if (h->backend)
+ vfs_backend_refdown(h->backend);
// TODO sanity check to check if refcount is true. handle_sanity?