aboutsummaryrefslogtreecommitdiff
path: root/net/tap-linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tap-linux.c')
-rw-r--r--net/tap-linux.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/tap-linux.c b/net/tap-linux.c
index 22ec2f4..e832810 100644
--- a/net/tap-linux.c
+++ b/net/tap-linux.c
@@ -124,7 +124,12 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
return -1;
}
pstrcpy(ifname, ifname_size, ifr.ifr_name);
- g_unix_set_fd_nonblocking(fd, true, NULL);
+
+ if (!qemu_set_blocking(fd, false, errp)) {
+ close(fd);
+ return -1;
+ }
+
return fd;
}