summary refs log tree commit diff stats
path: root/net/tap-bsd.c
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>2025-09-16 16:13:59 +0300
committerDaniel P. Berrangé <berrange@redhat.com>2025-09-19 12:46:07 +0100
commit6f607941b1c01679d6d3dca036ddd23bbe95a44c (patch)
tree41e43a055f178ad973c38bbf8877d1a438fbb8ae /net/tap-bsd.c
parent5d1d32ce9d26a7cdc1c60dceb1b0c55ff9ad9b3e (diff)
downloadfocaccia-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 'net/tap-bsd.c')
-rw-r--r--net/tap-bsd.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/net/tap-bsd.c b/net/tap-bsd.c
index b4c84441ba..3f98d0ea82 100644
--- a/net/tap-bsd.c
+++ b/net/tap-bsd.c
@@ -98,7 +98,12 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
             return -1;
         }
     }
-    g_unix_set_fd_nonblocking(fd, true, NULL);
+
+    if (!qemu_set_blocking(fd, false, errp)) {
+        close(fd);
+        return -1;
+    }
+
     return fd;
 }
 
@@ -189,7 +194,10 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
         goto error;
     }
 
-    g_unix_set_fd_nonblocking(fd, true, NULL);
+    if (!qemu_set_blocking(fd, false, errp)) {
+        goto error;
+    }
+
     return fd;
 
 error: