diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-04-25 11:56:42 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-05-03 15:47:38 +0400 |
commit | 22e135fca3f2512f43d39efab49067660e365e1b (patch) | |
tree | 11bdfaec65d018ab43269a916d8233f566262381 /tests/unit | |
parent | d640b59eb3c7925568c5b101f439b0c0e65ea313 (diff) | |
download | qemu-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 'tests/unit')
-rw-r--r-- | tests/unit/test-iov.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/test-iov.c b/tests/unit/test-iov.c index 0d2ba9b..93bda00 100644 --- a/tests/unit/test-iov.c +++ b/tests/unit/test-iov.c @@ -186,7 +186,7 @@ static void test_io(void) close(sv[0]); FD_SET(sv[1], &fds); - fcntl(sv[1], F_SETFL, O_RDWR|O_NONBLOCK); + g_unix_set_fd_nonblocking(sv[1], true, NULL); r = g_test_rand_int_range(sz / 2, sz); setsockopt(sv[1], SOL_SOCKET, SO_SNDBUF, &r, sizeof(r)); @@ -220,7 +220,7 @@ static void test_io(void) close(sv[1]); FD_SET(sv[0], &fds); - fcntl(sv[0], F_SETFL, O_RDWR|O_NONBLOCK); + g_unix_set_fd_nonblocking(sv[0], true, NULL); r = g_test_rand_int_range(sz / 2, sz); setsockopt(sv[0], SOL_SOCKET, SO_RCVBUF, &r, sizeof(r)); usleep(500000); |