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) {
}
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",
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);
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));