This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: java/net/natPlainSocketImpl.cc: compilation error on Solaris
- To: Alexandre Petit-Bianco <apbianco at cygnus dot com>
- Subject: Re: java/net/natPlainSocketImpl.cc: compilation error on Solaris
- From: Warren Levy <warrenl at cygnus dot com>
- Date: Thu, 2 Dec 1999 19:02:43 -0800 (PST)
- cc: java-discuss at sourceware dot cygnus dot com
On Thu, 2 Dec 1999, Alexandre Petit-Bianco wrote:
> I'm getting a build error on Solaris with ...
> + // Enable SO_REUSEADDR, so that servers can reuse ports left in TIME_WAIT.
> + ::setsockopt(fnum, SOL_SOCKET, SO_REUSEADDR, &i, sizeof(i));
A cast here is required similar to the other java.net instances of an int
used in the 4th parameter:
Index: natPlainSocketImpl.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/net/natPlainSocketImpl.cc,v
retrieving revision 1.14
diff -u -p -r1.14 natPlainSocketImpl.cc
--- natPlainSocketImpl.cc 1999/11/23 11:40:26 1.14
+++ natPlainSocketImpl.cc 1999/12/03 02:59:25
@@ -149,7 +149,7 @@ java::net::PlainSocketImpl::bind (java::
goto error;
// Enable SO_REUSEADDR, so that servers can reuse ports left in TIME_WAIT.
- ::setsockopt(fnum, SOL_SOCKET, SO_REUSEADDR, &i, sizeof(i));
+ ::setsockopt(fnum, SOL_SOCKET, SO_REUSEADDR, (char *) &i, sizeof(i));
if (::bind (fnum, ptr, len) == 0)
{
That should take care of it, so go ahead and check it in once your build
is working. Let me know if there's still a problem.
--warrenl