7032866: Problem with fix for 7030256
authormichaelm
Thu, 31 Mar 2011 17:37:11 +0100
changeset 9019 03920d69bb93
parent 9018 29184ade5361
child 9020 13b639abc930
7032866: Problem with fix for 7030256 Reviewed-by: alanb
jdk/src/windows/native/java/net/net_util_md.c
--- a/jdk/src/windows/native/java/net/net_util_md.c	Wed Mar 30 21:10:02 2011 -0700
+++ b/jdk/src/windows/native/java/net/net_util_md.c	Thu Mar 31 17:37:11 2011 +0100
@@ -230,7 +230,7 @@
 jint  IPv6_supported()
 {
     SOCKET s = socket(AF_INET6, SOCK_STREAM, 0) ;
-    if (s < 0) {
+    if (s == INVALID_SOCKET) {
         return JNI_FALSE;
     }
     closesocket(s);
@@ -775,7 +775,7 @@
     DWORD b;
     struct sockaddr_in6 route;
     SOCKET fd = socket(AF_INET6, SOCK_STREAM, 0);
-    if (fd < 0) {
+    if (fd == INVALID_SOCKET) {
         return 0;
     }
 
@@ -783,7 +783,7 @@
                     (void *)target_addr, sizeof(struct sockaddr_in6),
                     (void *)&route, sizeof(struct sockaddr_in6),
                     &b, 0, 0);
-    if (ret < 0) {
+    if (ret == SOCKET_ERROR) {
         // error
         closesocket(fd);
         return 0;