All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] linux-user: Flush errors by using exit() instead of _exit() in error path
@ 2026-04-25 14:48 Helge Deller
  2026-04-25 15:02 ` Warner Losh
  2026-04-26 13:01 ` Peter Maydell
  0 siblings, 2 replies; 10+ messages in thread
From: Helge Deller @ 2026-04-25 14:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: deller

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



^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [PATCH] linux-user: Flush errors by using exit() instead of _exit() in error path
@ 2026-04-26 14:41 Helge Deller
  2026-04-26 21:56 ` Richard Henderson
  0 siblings, 1 reply; 10+ messages in thread
From: Helge Deller @ 2026-04-26 14:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: deller, Warner Losh

From: Helge Deller <deller@gmx.de>

Similiar to previous patch - ensure that we always flush I/O by using
exit() instead of _exit().

Reported by: Tobias Bergkvist
Reviewed-by: Warner Losh <imp@bsdimp.com>
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 84e110dfe9..86d04cca3c 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -975,7 +975,7 @@ int main(int argc, char **argv, char **envp)
                       info, &bprm);
     if (ret != 0) {
         printf("Error while loading %s: %s\n", exec_path, strerror(-ret));
-        _exit(EXIT_FAILURE);
+        exit(EXIT_FAILURE);
     }
 
     for (wrk = target_environ; *wrk; wrk++) {
-- 
2.53.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-04-27  6:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-25 14:48 [PATCH] linux-user: Flush errors by using exit() instead of _exit() in error path Helge Deller
2026-04-25 15:02 ` 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

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.