From 6d8f2d0e93228a1aaecace14eb345fe1224b211f Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sun, 22 Aug 2021 13:06:26 +0200 Subject: process_switch_any: deduplicate some code --- src/kernel/syscalls.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/kernel/syscalls.c') diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c index b6eede6..2b3dafc 100644 --- a/src/kernel/syscalls.c +++ b/src/kernel/syscalls.c @@ -36,8 +36,7 @@ _Noreturn void _syscall_exit(const char *msg, size_t len) { if (process_current) process_switch(process_current); - tty_const("last process returned. "); - panic(); + process_switch_any(); } int _syscall_await(char *buf, int len) { @@ -55,13 +54,8 @@ int _syscall_await(char *buf, int len) { // no dead children yet // TODO check if the process even has children - - process_current = process_find(PS_RUNNING); - if (process_current) - process_switch(process_current); - - tty_const("this error will be fixed in the next commit."); // TODO - panic(); + + process_switch_any(); } int _syscall_fork() { -- cgit v1.2.3