From 07039b8a36008fdd6323c3a6ec2963fd4b4576bc Mon Sep 17 00:00:00 2001 From: Ville Juven Date: Tue, 21 Feb 2023 11:40:33 +0200 Subject: [PATCH] lib_abort.c: Change call to userspace exit() into syscall _exit() The POSIX standard dictates that during abnormal termination the functions registered by atexit() are _not_ called, also flushing the streams is optional. So in this case, it is perfectly legal / better to call the kernel system call _exit() instead. This fixes regression issues caused by removal exit() from the kernel. --- libs/libc/stdlib/lib_abort.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/libc/stdlib/lib_abort.c b/libs/libc/stdlib/lib_abort.c index 663e224274..e15508493e 100644 --- a/libs/libc/stdlib/lib_abort.c +++ b/libs/libc/stdlib/lib_abort.c @@ -63,8 +63,8 @@ void abort(void) * a conformant version of abort() at this time. This version does not * signal the calling thread all. * - * exit() will flush and close all open files and terminate the thread. + * _exit() will close all open files and terminate the thread. */ - exit(EXIT_FAILURE); + _exit(EXIT_FAILURE); }