aboutsummaryrefslogtreecommitdiff
path: root/chardev/char-serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'chardev/char-serial.c')
-rw-r--r--chardev/char-serial.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/chardev/char-serial.c b/chardev/char-serial.c
index 7c3d84ae24..4b0b83d5b4 100644
--- a/chardev/char-serial.c
+++ b/chardev/char-serial.c
@@ -271,7 +271,10 @@ static void qmp_chardev_open_serial(Chardev *chr,
if (fd < 0) {
return;
}
- qemu_set_nonblock(fd);
+ if (!g_unix_set_fd_nonblocking(fd, true, NULL)) {
+ error_setg_errno(errp, errno, "Failed to set FD nonblocking");
+ return;
+ }
tty_serial_init(fd, 115200, 'N', 8, 1);
qemu_chr_open_fd(chr, fd, fd);