From: Helge Deller <deller@kernel.org>
To: qemu-devel@nongnu.org
Cc: deller@gmx.de
Subject: [PATCH] linux-user: Flush errors by using exit() instead of _exit() in error path
Date: Sat, 25 Apr 2026 16:48:52 +0200 [thread overview]
Message-ID: <20260425144852.46590-1-deller@kernel.org> (raw)
From: Helge Deller <deller@gmx.de>
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>
---
linux-user/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index c49d1e91d2..84e110dfe9 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -767,7 +767,7 @@ int main(int argc, char **argv, char **envp)
execfd = open(exec_path, O_RDONLY);
if (execfd < 0) {
printf("Error while loading %s: %s\n", exec_path, strerror(errno));
- _exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
}
--
2.53.0
next reply other threads:[~2026-04-25 14:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-25 14:48 Helge Deller [this message]
2026-04-25 15:02 ` [PATCH] linux-user: Flush errors by using exit() instead of _exit() in error path Warner Losh
2026-04-25 15:17 ` Helge Deller
2026-04-25 15:50 ` Warner Losh
2026-04-26 13:06 ` Peter Maydell
2026-04-27 6:02 ` Philippe Mathieu-Daudé
2026-04-26 13:01 ` Peter Maydell
2026-04-26 14:37 ` Helge Deller
-- strict thread matches above, loose matches on Subject: below --
2026-04-26 14:41 Helge Deller
2026-04-26 21:56 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260425144852.46590-1-deller@kernel.org \
--to=deller@kernel.org \
--cc=deller@gmx.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.