OSDN Git Service

tests: use closesocket()
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 21 Feb 2023 12:47:47 +0000 (16:47 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 13 Mar 2023 11:23:37 +0000 (15:23 +0400)
Because they are actually sockets...

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230221124802.4103554-3-marcandre.lureau@redhat.com>

tests/unit/socket-helpers.c

index eecadf3..914b3aa 100644 (file)
@@ -117,13 +117,13 @@ static int socket_can_bind_connect(const char *hostname, int family)
 
  cleanup:
     if (afd != -1) {
-        close(afd);
+        closesocket(afd);
     }
     if (cfd != -1) {
-        close(cfd);
+        closesocket(cfd);
     }
     if (lfd != -1) {
-        close(lfd);
+        closesocket(lfd);
     }
     if (res) {
         freeaddrinfo(res);