From: Gurusamy Sarathy Date: Wed, 12 Nov 1997 03:39:57 +0000 (+0000) Subject: Add missing win32_closesocket() and export it (extension writers' complaint). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3a25acb49073f2e27090ba463a25de8bf4748c3f;p=p5sagit%2Fp5-mst-13.2.git Add missing win32_closesocket() and export it (extension writers' complaint). p4raw-id: //depot/win32/perl@239 --- diff --git a/win32/include/sys/socket.h b/win32/include/sys/socket.h index 9e5259b..487f9d5 100644 --- a/win32/include/sys/socket.h +++ b/win32/include/sys/socket.h @@ -115,6 +115,7 @@ void win32_endservent(void); #define recv win32_recv #define recvfrom win32_recvfrom #define shutdown win32_shutdown +#define closesocket win32_closesocket #define ioctlsocket win32_ioctlsocket #define setsockopt win32_setsockopt #define getsockopt win32_getsockopt diff --git a/win32/makedef.pl b/win32/makedef.pl index e398742..8925a2c 100644 --- a/win32/makedef.pl +++ b/win32/makedef.pl @@ -351,6 +351,7 @@ win32_sendto win32_recv win32_recvfrom win32_shutdown +win32_closesocket win32_ioctlsocket win32_setsockopt win32_getsockopt diff --git a/win32/win32sck.c b/win32/win32sck.c index 27ae060..a0fad00 100644 --- a/win32/win32sck.c +++ b/win32/win32sck.c @@ -33,6 +33,7 @@ #undef recv #undef recvfrom #undef shutdown +#undef closesocket #undef ioctlsocket #undef setsockopt #undef getsockopt @@ -382,15 +383,24 @@ win32_shutdown(SOCKET s, int how) return r; } +int +win32_closesocket(SOCKET s) +{ + int r; + + SOCKET_TEST_ERROR(r = closesocket(TO_SOCKET(s))); + return r; +} + SOCKET win32_socket(int af, int type, int protocol) { SOCKET s; - StartSockets(); #ifndef USE_SOCKETS_AS_HANDLES SOCKET_TEST(s = socket(af, type, protocol), INVALID_SOCKET); #else + StartSockets(); if((s = socket(af, type, protocol)) == INVALID_SOCKET) errno = WSAGetLastError(); else