summary refs log tree commit diff stats
path: root/net/tap-bsd.c
diff options
context:
space:
mode:
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: