aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libjava/ChangeLog5
-rw-r--r--libjava/gnu/java/net/natPlainSocketImplPosix.cc5
2 files changed, 10 insertions, 0 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index ec00d96..a1a208d 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,8 @@
+2006-07-21 Mohan Embar <gnustuff@thisiscool.com>
+
+ * gnu/java/net/natPlainSocketImplPosix.cc (bind): Clear
+ SockAddr before using - needed for OS X/PPC.
+
2006-07-21 Keith Seitz <keiths@redhat.com>
* boehm.cc (_Jv_SuspendThread): Don't ifdef the function declaration,
diff --git a/libjava/gnu/java/net/natPlainSocketImplPosix.cc b/libjava/gnu/java/net/natPlainSocketImplPosix.cc
index 28707db..2dfc38c 100644
--- a/libjava/gnu/java/net/natPlainSocketImplPosix.cc
+++ b/libjava/gnu/java/net/natPlainSocketImplPosix.cc
@@ -89,6 +89,11 @@ gnu::java::net::PlainSocketImpl::bind (::java::net::InetAddress *host, jint lpor
int len = haddress->length;
int i = 1;
+ // The following is needed for OS X/PPC, otherwise bind() fails with an
+ // error. I found the issue and following fix on some mailing list, but
+ // no explanation was given as to why this solved the problem.
+ memset (&u, 0, sizeof (u));
+
if (len == 4)
{
u.address.sin_family = AF_INET;