6983248: net/net001 and net/net003 fail on WinXP with JDK7-B108
authorzgu
Thu, 20 Jan 2011 10:45:58 -0500
changeset 7999 059b8737ff55
parent 7992 42ed82f1c067
child 8000 3e29b0310220
6983248: net/net001 and net/net003 fail on WinXP with JDK7-B108 Summary: 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
--- a/jdk/src/windows/demo/jvmti/hprof/hprof_md.c	Wed Jan 19 19:00:30 2011 -0800
+++ b/jdk/src/windows/demo/jvmti/hprof/hprof_md.c	Thu Jan 20 10:45:58 2011 -0500
@@ -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 <winsock2.h>
 #include <windows.h>
 #include <io.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <mmsystem.h>
-#include <winsock2.h>
 #include <fcntl.h>
 #include <process.h>
 
@@ -147,7 +149,7 @@
 void
 md_close(int filedes)
 {
-    (void)close(filedes);
+    (void)closesocket(filedes);
 }
 
 int