diff options
author | dzwdz | 2021-08-22 13:06:26 +0200 |
---|---|---|
committer | dzwdz | 2021-08-22 13:06:26 +0200 |
commit | 6d8f2d0e93228a1aaecace14eb345fe1224b211f (patch) | |
tree | 0ebe732053873fe85a52b64b1af2cac0ed27dbc9 /src/kernel/syscalls.c | |
parent | 374e6d244f184056d64fd02729a7badf02991e29 (diff) |
process_switch_any: deduplicate some code
Diffstat (limited to 'src/kernel/syscalls.c')
-rw-r--r-- | src/kernel/syscalls.c | 12 |
1 files changed, 3 insertions, 9 deletions
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() { |