aboutsummaryrefslogtreecommitdiff
path: root/kernel/features/syscall.c
diff options
context:
space:
mode:
authorMarvin Borner2021-02-14 17:07:29 +0100
committerMarvin Borner2021-02-14 17:07:29 +0100
commit1287f9dfe987f0456e4fb0741385d5f0278ef53b (patch)
tree64d3da484a4d186a725779f20d339432d51f441a /kernel/features/syscall.c
parentbc4e62f629a392e1a4cf204665e91c57f4e619b2 (diff)
Message waiting and more!
Diffstat (limited to 'kernel/features/syscall.c')
-rw-r--r--kernel/features/syscall.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/features/syscall.c b/kernel/features/syscall.c
index 80c3e9e..9f05471 100644
--- a/kernel/features/syscall.c
+++ b/kernel/features/syscall.c
@@ -40,8 +40,10 @@ void syscall_handler(struct regs *r)
if (vfs_ready((char *)r->ebx)) {
r->eax = (u32)vfs_read((char *)r->ebx, (void *)r->ecx, r->edx, r->esi);
} else {
- proc_wait_for(vfs_find_dev((char *)r->ebx)->id, PROC_WAIT_DEV, vfs_read);
- proc_yield(r);
+ if (vfs_wait((char *)r->ebx, vfs_read) < 0)
+ r->eax = -1;
+ else
+ proc_yield(r);
}
break;
}