]> git.proxmox.com Git - mirror_qemu.git/blobdiff - chardev/char-stdio.c
hw/arm/aspeed: Check for CPU types in machine_run_board_init()
[mirror_qemu.git] / chardev / char-stdio.c
index 82eaebc1db6528b9238455d0ae3710134abaebee..3c648678ab14c7bbbd802a0400e3d5625f81207b 100644 (file)
@@ -103,7 +103,10 @@ static void qemu_chr_open_stdio(Chardev *chr,
     stdio_in_use = true;
     old_fd0_flags = fcntl(0, F_GETFL);
     tcgetattr(0, &oldtty);
-    qemu_set_nonblock(0);
+    if (!g_unix_set_fd_nonblocking(0, true, NULL)) {
+        error_setg_errno(errp, errno, "Failed to set FD nonblocking");
+        return;
+    }
     atexit(term_exit);
 
     memset(&act, 0, sizeof(act));
@@ -112,9 +115,7 @@ static void qemu_chr_open_stdio(Chardev *chr,
 
     qemu_chr_open_fd(chr, 0, 1);
 
-    if (opts->has_signal) {
-        stdio_allow_signal = opts->signal;
-    }
+    stdio_allow_signal = !opts->has_signal || opts->signal;
     qemu_chr_set_echo_stdio(chr, false);
 }
 #endif