summary refs log tree commit diff stats
path: root/tests/unit/socket-helpers.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2023-02-21 16:48:01 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2023-03-13 15:39:31 +0400
commit25657fc6c1b693096e2ceadaa53cd10c1e81c8d9 (patch)
tree02de623f13a1d265022ddbdbf7433eb33f929d23 /tests/unit/socket-helpers.c
parentb7e5374637daffa49657be2c559a0566836a172f (diff)
downloadfocaccia-qemu-25657fc6c1b693096e2ceadaa53cd10c1e81c8d9.tar.gz
focaccia-qemu-25657fc6c1b693096e2ceadaa53cd10c1e81c8d9.zip
win32: replace closesocket() with close() wrapper
Use a close() wrapper instead, so that we don't need to worry about
closesocket() vs close() anymore, let's hope.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Message-Id: <20230221124802.4103554-17-marcandre.lureau@redhat.com>
Diffstat (limited to 'tests/unit/socket-helpers.c')
-rw-r--r--tests/unit/socket-helpers.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/unit/socket-helpers.c b/tests/unit/socket-helpers.c
index 914b3aa0cf..6de27baee2 100644
--- a/tests/unit/socket-helpers.c
+++ b/tests/unit/socket-helpers.c
@@ -117,13 +117,13 @@ static int socket_can_bind_connect(const char *hostname, int family)
 
  cleanup:
     if (afd != -1) {
-        closesocket(afd);
+        close(afd);
     }
     if (cfd != -1) {
-        closesocket(cfd);
+        close(cfd);
     }
     if (lfd != -1) {
-        closesocket(lfd);
+        close(lfd);
     }
     if (res) {
         freeaddrinfo(res);
@@ -160,7 +160,7 @@ void socket_check_afunix_support(bool *has_afunix)
     int fd;
 
     fd = socket(PF_UNIX, SOCK_STREAM, 0);
-    closesocket(fd);
+    close(fd);
 
 #ifdef _WIN32
     *has_afunix = (fd != (int)INVALID_SOCKET);