From bfe381768bf9fde9595a7fdacfb8037458fc0f6a Mon Sep 17 00:00:00 2001 From: dzwdz Date: Mon, 26 Jul 2021 16:40:35 +0200 Subject: mark sc_exit() as noreturn gets rid of the double panic() call --- src/kernel/syscalls.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c index 27e835d..a6a2b17 100644 --- a/src/kernel/syscalls.c +++ b/src/kernel/syscalls.c @@ -4,9 +4,7 @@ #include #include -int sc_exit(const char *msg, size_t len) { - // the message is currently ignored - +_Noreturn void sc_exit(const char *msg, size_t len) { log_const("last process returned. "); panic(); } @@ -29,7 +27,6 @@ int syscall_handler(int num, int a, int b, int c) { switch (num) { case SC_EXIT: sc_exit((void*)a, b); - panic(); // sc_exit should never return case SC_DEBUGLOG: return sc_debuglog((void*)a, b); default: -- cgit v1.2.3