]> git.proxmox.com Git - qemu.git/blobdiff - qemu-progress.c
usb-linux: Add support for buffering iso out usb packets
[qemu.git] / qemu-progress.c
index e1feb8961479235b433a1afe27f0a20902f94408..a4894c0dfc5ecaa0ebb2091d71392da1d9ca7c46 100644 (file)
@@ -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)