aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2022-04-25 11:56:42 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2022-05-03 15:47:38 +0400
commit22e135fca3f2512f43d39efab49067660e365e1b (patch)
tree11bdfaec65d018ab43269a916d8233f566262381 /net
parentd640b59eb3c7925568c5b101f439b0c0e65ea313 (diff)
downloadqemu-22e135fca3f2512f43d39efab49067660e365e1b.zip
qemu-22e135fca3f2512f43d39efab49067660e365e1b.tar.gz
qemu-22e135fca3f2512f43d39efab49067660e365e1b.tar.bz2
Replace fcntl(O_NONBLOCK) with g_unix_set_fd_nonblocking()
Suggested-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'net')
-rw-r--r--net/tap-bsd.c4
-rw-r--r--net/tap-linux.c2
-rw-r--r--net/tap-solaris.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/net/tap-bsd.c b/net/tap-bsd.c
index 7e65bd3..005ce05 100644
--- a/net/tap-bsd.c
+++ b/net/tap-bsd.c
@@ -98,7 +98,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
return -1;
}
}
- fcntl(fd, F_SETFL, O_NONBLOCK);
+ g_unix_set_fd_nonblocking(fd, true, NULL);
return fd;
}
@@ -189,7 +189,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
goto error;
}
- fcntl(fd, F_SETFL, O_NONBLOCK);
+ g_unix_set_fd_nonblocking(fd, true, NULL);
return fd;
error:
diff --git a/net/tap-linux.c b/net/tap-linux.c
index 3e24d23..304ff45 100644
--- a/net/tap-linux.c
+++ b/net/tap-linux.c
@@ -113,7 +113,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
return -1;
}
pstrcpy(ifname, ifname_size, ifr.ifr_name);
- fcntl(fd, F_SETFL, O_NONBLOCK);
+ g_unix_set_fd_nonblocking(fd, true, NULL);
return fd;
}
diff --git a/net/tap-solaris.c b/net/tap-solaris.c
index 7991978..a44f880 100644
--- a/net/tap-solaris.c
+++ b/net/tap-solaris.c
@@ -198,7 +198,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
return -1;
}
}
- fcntl(fd, F_SETFL, O_NONBLOCK);
+ g_unix_set_fd_nonblocking(fd, true, NULL);
return fd;
}