aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu
diff options
context:
space:
mode:
authorMohan Embar <gnustuff@thisiscool.com>2006-07-22 01:42:25 +0000
committerMohan Embar <membar@gcc.gnu.org>2006-07-22 01:42:25 +0000
commit105395ad98c7d9c0141603aa84773af5dd08a461 (patch)
treeb86c81b7eb34b919fd616fb69f5c4fe3bb58c2ea /libjava/gnu
parenteb1ff706c03e02cd97a838d882bd9fa55df573fd (diff)
downloadgcc-105395ad98c7d9c0141603aa84773af5dd08a461.zip
gcc-105395ad98c7d9c0141603aa84773af5dd08a461.tar.gz
gcc-105395ad98c7d9c0141603aa84773af5dd08a461.tar.bz2
natPlainSocketImplPosix.cc (bind): Clear SockAddr before using - needed for OS X/PPC.
2006-07-21 Mohan Embar <gnustuff@thisiscool.com> * gnu/java/net/natPlainSocketImplPosix.cc (bind): Clear SockAddr before using - needed for OS X/PPC. From-SVN: r115669
Diffstat (limited to 'libjava/gnu')
-rw-r--r--libjava/gnu/java/net/natPlainSocketImplPosix.cc5
1 files changed, 5 insertions, 0 deletions
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;