diff options
| author | Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> | 2025-09-16 16:13:59 +0300 |
|---|---|---|
| committer | Daniel P. Berrangé <berrange@redhat.com> | 2025-09-19 12:46:07 +0100 |
| commit | 6f607941b1c01679d6d3dca036ddd23bbe95a44c (patch) | |
| tree | 41e43a055f178ad973c38bbf8877d1a438fbb8ae /io/channel-command.c | |
| parent | 5d1d32ce9d26a7cdc1c60dceb1b0c55ff9ad9b3e (diff) | |
| download | focaccia-qemu-6f607941b1c01679d6d3dca036ddd23bbe95a44c.tar.gz focaccia-qemu-6f607941b1c01679d6d3dca036ddd23bbe95a44c.zip | |
treewide: use qemu_set_blocking instead of g_unix_set_fd_nonblocking
Instead of open-coded g_unix_set_fd_nonblocking() calls, use QEMU wrapper qemu_set_blocking(). Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> [DB: fix missing closing ) in tap-bsd.c, remove now unused GError var] Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'io/channel-command.c')
| -rw-r--r-- | io/channel-command.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/io/channel-command.c b/io/channel-command.c index 8966dd3a2b..8ae9a026b3 100644 --- a/io/channel-command.c +++ b/io/channel-command.c @@ -277,9 +277,12 @@ static int qio_channel_command_set_blocking(QIOChannel *ioc, cioc->blocking = enabled; #else - if ((cioc->writefd >= 0 && !g_unix_set_fd_nonblocking(cioc->writefd, !enabled, NULL)) || - (cioc->readfd >= 0 && !g_unix_set_fd_nonblocking(cioc->readfd, !enabled, NULL))) { - error_setg_errno(errp, errno, "Failed to set FD nonblocking"); + if (cioc->writefd >= 0 && + !qemu_set_blocking(cioc->writefd, enabled, errp)) { + return -1; + } + if (cioc->readfd >= 0 && + !qemu_set_blocking(cioc->readfd, enabled, errp)) { return -1; } #endif |