aboutsummaryrefslogtreecommitdiff
path: root/chardev/char-pty.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2022-04-25 17:39:06 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2022-05-03 15:51:52 +0400
commitb84bb4dfe5d03b40c91260db8ee07d65809fc35f (patch)
tree16e770c0a41aa2cd5a848572633b3b9f7a8d2359 /chardev/char-pty.c
parent05e50e8fe5fed707653e1e5e2f2871f253a70452 (diff)
chardev: replace qemu_set_nonblock()
Those calls are either for non-socket fd, or are POSIX-specific. Use the dedicated GLib API. (qemu_set_nonblock() is for socket-like) (this is a preliminary patch before renaming qemu_set_nonblock()) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'chardev/char-pty.c')
-rw-r--r--chardev/char-pty.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/chardev/char-pty.c b/chardev/char-pty.c
index 1e2863f532..53f25c6bbd 100644
--- a/chardev/char-pty.c
+++ b/chardev/char-pty.c
@@ -324,7 +324,10 @@ static void char_pty_open(Chardev *chr,
}
close(slave_fd);
- qemu_set_nonblock(master_fd);
+ if (!g_unix_set_fd_nonblocking(master_fd, true, NULL)) {
+ error_setg_errno(errp, errno, "Failed to set FD nonblocking");
+ return;
+ }
chr->filename = g_strdup_printf("pty:%s", pty_name);
qemu_printf("char device redirected to %s (label %s)\n",