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

Helge Deller posted 1 patch 4 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260426144100.4037-1-deller@kernel.org
Maintainers: Laurent Vivier <laurent@vivier.eu>, Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
linux-user/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] linux-user: Flush errors by using exit() instead of _exit() in error path
Posted by Helge Deller 4 weeks ago
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
Re: [PATCH] linux-user: Flush errors by using exit() instead of _exit() in error path
Posted by Richard Henderson 4 weeks ago
On 4/27/26 00:41, Helge Deller wrote:
> 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++) {

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~