From bf4cbc830d78774ac00d9501c45e8b84d0ae9ae7 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Wed, 29 Jun 2022 21:52:15 +0200 Subject: kernel/vfs: add the OPEN_CREATE flag --- src/init/driver/ps2.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/init/driver/ps2.c') diff --git a/src/init/driver/ps2.c b/src/init/driver/ps2.c index b2d42e5..0c6d548 100644 --- a/src/init/driver/ps2.c +++ b/src/init/driver/ps2.c @@ -51,6 +51,10 @@ static void main_loop(void) { while (!_syscall_fs_wait(buf, sizeof buf, &res)) { switch (res.op) { case VFSOP_OPEN: + if (res.flags & OPEN_CREATE) { + _syscall_fs_respond(NULL, -1); + break; + } _syscall_fs_respond(NULL, 1); break; @@ -74,7 +78,7 @@ static void main_loop(void) { } void ps2_drv(void) { - fd = _syscall_open("/ps2", 4); + fd = _syscall_open("/ps2", 4, 0); if (fd < 0) _syscall_exit(1); main_loop(); -- cgit v1.2.3