summaryrefslogtreecommitdiffstats
path: root/chardev/char-stdio.c
diff options
context:
space:
mode:
authorMarc-André Lureau2022-04-25 15:39:06 +0200
committerMarc-André Lureau2022-05-03 13:51:52 +0200
commitb84bb4dfe5d03b40c91260db8ee07d65809fc35f (patch)
tree16e770c0a41aa2cd5a848572633b3b9f7a8d2359 /chardev/char-stdio.c
parentio: make qio_channel_command_new_pid() static (diff)
downloadqemu-b84bb4dfe5d03b40c91260db8ee07d65809fc35f.tar.gz
qemu-b84bb4dfe5d03b40c91260db8ee07d65809fc35f.tar.xz
qemu-b84bb4dfe5d03b40c91260db8ee07d65809fc35f.zip
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-stdio.c')
-rw-r--r--chardev/char-stdio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/chardev/char-stdio.c b/chardev/char-stdio.c
index 403da308c9..3c648678ab 100644
--- a/chardev/char-stdio.c
+++ b/chardev/char-stdio.c
@@ -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));