From 29a7fcb19968beac251215b100f86b11d2c7e070 Mon Sep 17 00:00:00 2001 From: membar Date: Sat, 22 Jul 2006 01:42:25 +0000 Subject: 2006-07-21 Mohan Embar * gnu/java/net/natPlainSocketImplPosix.cc (bind): Clear SockAddr before using - needed for OS X/PPC. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115669 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/gnu/java/net/natPlainSocketImplPosix.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libjava/gnu/java') diff --git a/libjava/gnu/java/net/natPlainSocketImplPosix.cc b/libjava/gnu/java/net/natPlainSocketImplPosix.cc index 28707db4de8..2dfc38cda5e 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; -- cgit v1.2.3