diff options
-rw-r--r-- | qemu-progress.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/qemu-progress.c b/qemu-progress.c index e1feb89614..a4894c0dfc 100644 --- a/qemu-progress.c +++ b/qemu-progress.c @@ -37,6 +37,7 @@ struct progress_state { }; static struct progress_state state; +static volatile sig_atomic_t print_pending; /* * Simple progress print function. @@ -63,12 +64,16 @@ static void progress_simple_init(void) #ifdef CONFIG_POSIX static void sigusr_print(int signal) { - printf(" (%3.2f/100%%)\n", state.current); + print_pending = 1; } #endif static void progress_dummy_print(void) { + if (print_pending) { + fprintf(stderr, " (%3.2f/100%%)\n", state.current); + print_pending = 0; + } } static void progress_dummy_end(void) |