diff options
Diffstat (limited to 'tests/unit/socket-helpers.c')
-rw-r--r-- | tests/unit/socket-helpers.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/unit/socket-helpers.c b/tests/unit/socket-helpers.c index f3439cc..46d2ff1 100644 --- a/tests/unit/socket-helpers.c +++ b/tests/unit/socket-helpers.c @@ -19,6 +19,7 @@ */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu/sockets.h" #include "socket-helpers.h" @@ -88,7 +89,8 @@ static int socket_can_bind_connect(const char *hostname, int family) goto cleanup; } - qemu_socket_set_nonblock(cfd); + qemu_set_blocking(cfd, false, &error_abort); + if (connect(cfd, (struct sockaddr *)&ss, sslen) < 0) { if (errno == EINPROGRESS) { check_soerr = true; @@ -170,5 +172,4 @@ void socket_check_afunix_support(bool *has_afunix) if (*has_afunix) { close(fd); } - return; } |