Skip to contentSkip to conversation

flush stdout after printing usage()

PATCH Applied Riku Voipio 2 participants 2 messages Feb 27, 2009 – Feb 28, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 flush stdout after printing usage()

fixes qemu-arm|grep cpu - with _exit() getting output from qemu --help is a bit random. Since no atexit() handlers are registered for user mode emulation, just use exit() instead.

---
 bsd-user/main.c    |    4 ++--
 darwin-user/main.c |    4 ++--
 linux-user/main.c  |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
bsd-user/main.c +2 -2
index 7d0d4b3..74a1ba6 100644
@@ -351,7 +351,7 @@ static void usage(void)
            interp_prefix,
            x86_stack_size,
            DEBUG_LOGFILE);
-    _exit(1);
+    exit(1);
 }
 
 THREAD CPUState *thread_env;
@@ -448,7 +448,7 @@ int main(int argc, char **argv)
 #if defined(cpu_list)
                     cpu_list(stdout, &fprintf);
 #endif
-                _exit(1);
+                exit(1);
             }
         } else if (!strcmp(r, "drop-ld-preload")) {
             drop_ld_preload = 1;
darwin-user/main.c +2 -2
index 24e738b..9b8a3dc 100644
@@ -756,7 +756,7 @@ void usage(void)
            interp_prefix,
            stack_size,
            DEBUG_LOGFILE);
-    _exit(1);
+    exit(1);
 }
 
 /* XXX: currently only used for async signals (see signal.c) */
@@ -840,7 +840,7 @@ int main(int argc, char **argv)
 #if defined(cpu_list)
                     cpu_list(stdout, &fprintf);
 #endif
-                _exit(1);
+                exit(1);
             }
         } else
         {
linux-user/main.c +2 -2
index 00259dc..6e2984c 100644
@@ -2213,7 +2213,7 @@ static void usage(void)
            interp_prefix,
            x86_stack_size,
            DEBUG_LOGFILE);
-    _exit(1);
+    exit(1);
 }
 
 THREAD CPUState *thread_env;
@@ -2335,7 +2335,7 @@ int main(int argc, char **argv, char **envp)
 #if defined(cpu_list)
                     cpu_list(stdout, &fprintf);
 #endif
-                _exit(1);
+                exit(1);
             }
         } else if (!strcmp(r, "drop-ld-preload")) {
             (void) envlist_unsetenv(envlist, "LD_PRELOAD");
Signature · 5 lines
1.6.1.3


-- 
"rm -rf" only sounds scary if you don't have backups
Applied
#1 lore raw
Quoted 5 lines · Riku Voipio

fixes qemu-arm|grep cpu - with _exit() getting output from qemu --help
is a bit random. Since no atexit() handlers are registered for user mode emulation, just use exit() instead.

Thanks, applied.