diff options
Diffstat (limited to 'net/tap-bsd.c')
-rw-r--r-- | net/tap-bsd.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/tap-bsd.c b/net/tap-bsd.c index b4c8444..3f98d0e 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: |