diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/user/app/init/driver/ps2.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/user/app/init/driver/ps2.c b/src/user/app/init/driver/ps2.c index 4fee60a..2752238 100644 --- a/src/user/app/init/driver/ps2.c +++ b/src/user/app/init/driver/ps2.c @@ -1,9 +1,10 @@ #include "driver.h" +#include <camellia/compat.h> #include <camellia/syscalls.h> +#include <errno.h> #include <shared/ring.h> #include <stdbool.h> #include <stdlib.h> -#include <camellia/compat.h> static const char keymap_lower[] = { @@ -55,9 +56,15 @@ static void main_loop(void) { struct ufs_request res; int ret; while (!c0_fs_wait(buf, sizeof buf, &res)) { + // TODO don't hang on ps2 reads + switch (res.op) { case VFSOP_OPEN: - c0_fs_respond(NULL, 1, 0); + if (res.len == 0) { + c0_fs_respond(NULL, 1, 0); + } else { + c0_fs_respond(NULL, -ENOENT, 0); + } break; case VFSOP_READ: |