diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-04-25 17:39:06 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-05-03 15:51:52 +0400 |
commit | b84bb4dfe5d03b40c91260db8ee07d65809fc35f (patch) | |
tree | 16e770c0a41aa2cd5a848572633b3b9f7a8d2359 /chardev/char-fd.c | |
parent | 05e50e8fe5fed707653e1e5e2f2871f253a70452 (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-fd.c')
-rw-r--r-- | chardev/char-fd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chardev/char-fd.c b/chardev/char-fd.c index 6ec9682b22..cf78454841 100644 --- a/chardev/char-fd.c +++ b/chardev/char-fd.c @@ -212,8 +212,8 @@ void qemu_chr_open_fd(Chardev *chr, FDChardev *s = FD_CHARDEV(chr); g_autofree char *name = NULL; - if (fd_out >= 0) { - qemu_set_nonblock(fd_out); + if (fd_out >= 0 && !g_unix_set_fd_nonblocking(fd_out, true, NULL)) { + assert(!"Failed to set FD nonblocking"); } if (fd_out == fd_in && fd_in >= 0) { |