aboutsummaryrefslogtreecommitdiff
path: root/io/channel-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'io/channel-file.c')
-rw-r--r--io/channel-file.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/io/channel-file.c b/io/channel-file.c
index d7cf6d278f..d146ace7db 100644
--- a/io/channel-file.c
+++ b/io/channel-file.c
@@ -139,14 +139,19 @@ static int qio_channel_file_set_blocking(QIOChannel *ioc,
bool enabled,
Error **errp)
{
+#ifdef WIN32
+ /* not implemented */
+ error_setg_errno(errp, errno, "Failed to set FD nonblocking");
+ return -1;
+#else
QIOChannelFile *fioc = QIO_CHANNEL_FILE(ioc);
- if (enabled) {
- qemu_set_block(fioc->fd);
- } else {
- qemu_set_nonblock(fioc->fd);
+ if (!g_unix_set_fd_nonblocking(fioc->fd, !enabled, NULL)) {
+ error_setg_errno(errp, errno, "Failed to set FD nonblocking");
+ return -1;
}
return 0;
+#endif
}