@samitouri / QOSamiQemu / commits / 9e7734ead1

linux-user: Flush errors by using exit() instead of _exit() in error path

Qemu user mode does not properly flushes error messages related to bad arguments when exiting (at least when the output is piped to a file instead of running on a terminal). Ensure that we always flush by using exit() instead of _exit(). Reported by: Tobias Bergkvist Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/2544 Signed-off-by: Helge Deller <deller@gmx.de>

Helge Deller committed Apr 25, 2026 at 16:38 UTC 9e7734ead149d73f1d25f61d0b7f075d4b2cb07d
1 file changed +1 -1
linux-user/main.c
+1 -1
@@ -767,7 +767,7 @@ int main(int argc, char **argv, char **envp)
767 execfd = open(exec_path, O_RDONLY);
768 if (execfd < 0) {
769 printf("Error while loading %s: %s\n", exec_path, strerror(errno));
770 - _exit(EXIT_FAILURE);
770 + exit(EXIT_FAILURE);
771 }
772 }
773