From 25657fc6c1b693096e2ceadaa53cd10c1e81c8d9 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Tue, 21 Feb 2023 16:48:01 +0400 Subject: win32: replace closesocket() with close() wrapper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Stefan Berger Message-Id: <20230221124802.4103554-17-marcandre.lureau@redhat.com> --- tests/unit/socket-helpers.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/unit/socket-helpers.c') 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); -- cgit 1.4.1