From 16048adbc1940f17337e72f2f11d12d391ecdcf5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Szil=C3=A1rd=20Bir=C3=B3?=
Date: Thu, 19 Sep 2024 21:35:37 +0200
Subject: [PATCH] turn closesocket into a function (#409)
Co-authored-by: Dethrace Engineering Department <78985374+dethrace-labs@users.noreply.github.com>
---
src/harness/include/harness/winsock.h | 2 +-
src/harness/win95/winsock.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/harness/include/harness/winsock.h b/src/harness/include/harness/winsock.h
index 51ab2ee9..46aa8303 100644
--- a/src/harness/include/harness/winsock.h
+++ b/src/harness/include/harness/winsock.h
@@ -23,7 +23,6 @@
#include
#include // for close()
-#define closesocket(x) close(x)
#define WSAEISCONN EISCONN
#define WSAEINPROGRESS EINPROGRESS
#define WSAEALREADY EALREADY
@@ -46,6 +45,7 @@ int WSAStartup(int version, WSADATA* data);
int WSAGetLastError(void);
int WSACleanup(void);
int ioctlsocket(int handle, long cmd, unsigned long* argp);
+int closesocket(int handle);
#endif /* _WIN32 */
diff --git a/src/harness/win95/winsock.c b/src/harness/win95/winsock.c
index 15e86e83..7d47f344 100644
--- a/src/harness/win95/winsock.c
+++ b/src/harness/win95/winsock.c
@@ -24,4 +24,8 @@ int ioctlsocket(int handle, long cmd, unsigned long* argp) {
return fcntl(handle, F_SETFL, flags);
}
+int closesocket(int handle) {
+ return close(handle);
+}
+
#endif