From a534ff63b7b7dfca72bae706ce146b4a4175f6a8 Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Thu, 20 Jan 2011 10:45:58 -0500 Subject: [PATCH] 6983248: net/net001 and net/net003 fail on WinXP with JDK7-B108 Using closesocket to close socket handler to avoid invalid C runtime parameter exception. Reviewed-by: alanb, phh, dcubed, dsamersoff, coleenp, acorn --- jdk/src/windows/demo/jvmti/hprof/hprof_md.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jdk/src/windows/demo/jvmti/hprof/hprof_md.c b/jdk/src/windows/demo/jvmti/hprof/hprof_md.c index 14ede2bb147..03e77f635d5 100644 --- a/jdk/src/windows/demo/jvmti/hprof/hprof_md.c +++ b/jdk/src/windows/demo/jvmti/hprof/hprof_md.c @@ -29,12 +29,14 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// To ensure winsock2.h is used, it has to be included ahead of +// windows.h, which includes winsock.h by default. +#include #include #include #include #include #include -#include #include #include @@ -147,7 +149,7 @@ md_seek(int filedes, jlong pos) void md_close(int filedes) { - (void)close(filedes); + (void)closesocket(filedes); } int