Skip to contentSkip to conversation

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

PATCH In review Helge Deller 2 participants 2 messages Apr 26

lore
Share & tools
lore
#0 lore raw

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

From: Helge Deller <[email protected]>

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

Reported by: Tobias Bergkvist

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/2544

---
 linux-user/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/main.c +1 -1
index 84e110dfe9..86d04cca3c 100644
@@ -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++) {
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Helge Deller

From: Helge Deller <[email protected]>

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

Reported by: Tobias Bergkvist

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/2544

---
  linux-user/main.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/main.c +0 -0
index 84e110dfe9..86d04cca3c 100644

linux-user/main.c int main(int argc, char **argv, char **envp) · line 981

Quoted 8 lines
linux-user/main.c +1 -1
@@ -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++) {

r~