6730740: Fix for 6729881 has apparently broken several 64 bit tests: "Bad address"
Reviewed-by: alanb, jccollet
--- 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;
}