6730740: Fix for 6729881 has apparently broken several 64 bit tests: "Bad address"
authorchegar
Tue, 29 Jul 2008 09:53:35 -0700
changeset 911 9edd1b9607e2
parent 910 1f53246fb014
child 912 3322af753f62
6730740: Fix for 6729881 has apparently broken several 64 bit tests: "Bad address" Reviewed-by: alanb, jccollet
jdk/src/solaris/native/java/net/linux_close.c
jdk/src/solaris/native/java/net/net_util_md.c
--- a/jdk/src/solaris/native/java/net/linux_close.c	Mon Jul 28 13:02:11 2008 +0100
+++ b/jdk/src/solaris/native/java/net/linux_close.c	Tue Jul 29 09:53:35 2008 -0700
@@ -281,7 +281,9 @@
 
 int NET_RecvFrom(int s, void *buf, int len, unsigned int flags,
        struct sockaddr *from, int *fromlen) {
-    BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, (socklen_t)fromlen) );
+    socklen_t socklen = *fromlen;
+    BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, &socklen) );
+    *fromlen = socklen;
 }
 
 int NET_Send(int s, void *msg, int len, unsigned int flags) {
@@ -298,7 +300,9 @@
 }
 
 int NET_Accept(int s, struct sockaddr *addr, int *addrlen) {
-    BLOCKING_IO_RETURN_INT( s, accept(s, addr, (socklen_t)addrlen) );
+    socklen_t socklen = *addrlen;
+    BLOCKING_IO_RETURN_INT( s, accept(s, addr, &socklen) );
+    *addrlen = socklen;
 }
 
 int NET_Connect(int s, struct sockaddr *addr, int addrlen) {
--- a/jdk/src/solaris/native/java/net/net_util_md.c	Mon Jul 28 13:02:11 2008 +0100
+++ b/jdk/src/solaris/native/java/net/net_util_md.c	Tue Jul 29 09:53:35 2008 -0700
@@ -1085,7 +1085,16 @@
     }
 #endif
 
-    rv = getsockopt(fd, level, opt, result, (socklen_t)len);
+#ifdef __solaris__
+    rv = getsockopt(fd, level, opt, result, len);
+#else
+    {
+        socklen_t socklen = *len;
+        rv = getsockopt(fd, level, opt, result, &socklen);
+        *len = socklen;
+    }
+#endif
+
     if (rv < 0) {
         return rv;
     }