diff options
author | Tom Tromey <tromey@redhat.com> | 2007-04-02 22:10:41 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2007-04-02 22:10:41 +0000 |
commit | c44cc446f7d34edab0c3080928e3735575665602 (patch) | |
tree | 7ad846a0163eaba98c9fe1213f2b4a3a8a18a96c /libjava | |
parent | c8bbabf282817c068f44b944a467ac71e67259e0 (diff) | |
download | gcc-c44cc446f7d34edab0c3080928e3735575665602.zip gcc-c44cc446f7d34edab0c3080928e3735575665602.tar.gz gcc-c44cc446f7d34edab0c3080928e3735575665602.tar.bz2 |
natPlainSocketImplPosix.cc (create): Return if already created.
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=233406
* gnu/java/net/natPlainSocketImplPosix.cc (create): Return if
already created.
* gnu/java/net/PlainSocketImpl.java (getLocalAddress): Handle case
where localport is -1.
(create): Now public.
* gnu/java/nio/SocketChannelImpl.java (SocketChannelImpl): Call
'create' on the socket.
From-SVN: r123440
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 11 | ||||
-rw-r--r-- | libjava/classpath/lib/gnu/classpath/jdwp/event/ThreadStartEvent.class | bin | 1146 -> 1146 bytes | |||
-rw-r--r-- | libjava/classpath/lib/gnu/classpath/jdwp/transport/SocketTransport.class | bin | 2603 -> 2696 bytes | |||
-rw-r--r-- | libjava/classpath/lib/gnu/java/net/PlainSocketImpl$SocketInputStream.class | bin | 810 -> 810 bytes | |||
-rw-r--r-- | libjava/classpath/lib/gnu/java/net/PlainSocketImpl$SocketOutputStream.class | bin | 720 -> 720 bytes | |||
-rw-r--r-- | libjava/classpath/lib/gnu/java/net/PlainSocketImpl.class | bin | 3586 -> 3598 bytes | |||
-rw-r--r-- | libjava/classpath/lib/gnu/java/nio/SocketChannelImpl.class | bin | 5935 -> 5966 bytes | |||
-rw-r--r-- | libjava/gnu/java/net/PlainSocketImpl.java | 6 | ||||
-rw-r--r-- | libjava/gnu/java/net/natPlainSocketImplPosix.cc | 4 | ||||
-rw-r--r-- | libjava/gnu/java/nio/SocketChannelImpl.java | 3 |
10 files changed, 21 insertions, 3 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index dce810f..ca939837 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,14 @@ +2007-04-02 Tom Tromey <tromey@redhat.com> + + https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=233406 + * gnu/java/net/natPlainSocketImplPosix.cc (create): Return if + already created. + * gnu/java/net/PlainSocketImpl.java (getLocalAddress): Handle case + where localport is -1. + (create): Now public. + * gnu/java/nio/SocketChannelImpl.java (SocketChannelImpl): Call + 'create' on the socket. + 2007-04-02 Andrew Haley <aph@redhat.com> * java/lang/reflect/natVMProxy.cc (run_proxy): Use diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/ThreadStartEvent.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/ThreadStartEvent.class Binary files differindex 05fd3dc..84f88dd 100644 --- a/libjava/classpath/lib/gnu/classpath/jdwp/event/ThreadStartEvent.class +++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/ThreadStartEvent.class diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/transport/SocketTransport.class b/libjava/classpath/lib/gnu/classpath/jdwp/transport/SocketTransport.class Binary files differindex 8d7f093..eb7fc33 100644 --- a/libjava/classpath/lib/gnu/classpath/jdwp/transport/SocketTransport.class +++ b/libjava/classpath/lib/gnu/classpath/jdwp/transport/SocketTransport.class diff --git a/libjava/classpath/lib/gnu/java/net/PlainSocketImpl$SocketInputStream.class b/libjava/classpath/lib/gnu/java/net/PlainSocketImpl$SocketInputStream.class Binary files differindex 5c42da8..28c8a6d 100644 --- a/libjava/classpath/lib/gnu/java/net/PlainSocketImpl$SocketInputStream.class +++ b/libjava/classpath/lib/gnu/java/net/PlainSocketImpl$SocketInputStream.class diff --git a/libjava/classpath/lib/gnu/java/net/PlainSocketImpl$SocketOutputStream.class b/libjava/classpath/lib/gnu/java/net/PlainSocketImpl$SocketOutputStream.class Binary files differindex 739340f..58cd4b9 100644 --- a/libjava/classpath/lib/gnu/java/net/PlainSocketImpl$SocketOutputStream.class +++ b/libjava/classpath/lib/gnu/java/net/PlainSocketImpl$SocketOutputStream.class diff --git a/libjava/classpath/lib/gnu/java/net/PlainSocketImpl.class b/libjava/classpath/lib/gnu/java/net/PlainSocketImpl.class Binary files differindex 1e26dd5..1eaf658 100644 --- a/libjava/classpath/lib/gnu/java/net/PlainSocketImpl.class +++ b/libjava/classpath/lib/gnu/java/net/PlainSocketImpl.class diff --git a/libjava/classpath/lib/gnu/java/nio/SocketChannelImpl.class b/libjava/classpath/lib/gnu/java/nio/SocketChannelImpl.class Binary files differindex 26c94fc..88548eb 100644 --- a/libjava/classpath/lib/gnu/java/nio/SocketChannelImpl.class +++ b/libjava/classpath/lib/gnu/java/nio/SocketChannelImpl.class diff --git a/libjava/gnu/java/net/PlainSocketImpl.java b/libjava/gnu/java/net/PlainSocketImpl.java index dad1724..d2c8f02 100644 --- a/libjava/gnu/java/net/PlainSocketImpl.java +++ b/libjava/gnu/java/net/PlainSocketImpl.java @@ -228,7 +228,9 @@ public final class PlainSocketImpl extends SocketImpl * * @param stream true for a stream socket, false for a datagram socket */ - protected native void create(boolean stream) throws IOException; + // FIXME: this is public for nio ... but this is just a hack + // until we upgrade to Classpath's nio. + public native void create(boolean stream) throws IOException; /** * Connects to the remote hostname and port specified as arguments. @@ -336,7 +338,7 @@ public final class PlainSocketImpl extends SocketImpl { localSocketAddress = new InetSocketAddress ((InetAddress) getOption(SocketOptions.SO_BINDADDR), - localport); + localport == -1 ? 0 : localport); } catch (SocketException _) { diff --git a/libjava/gnu/java/net/natPlainSocketImplPosix.cc b/libjava/gnu/java/net/natPlainSocketImplPosix.cc index d16f1d3..b4f4a85 100644 --- a/libjava/gnu/java/net/natPlainSocketImplPosix.cc +++ b/libjava/gnu/java/net/natPlainSocketImplPosix.cc @@ -64,6 +64,10 @@ union SockAddr void gnu::java::net::PlainSocketImpl::create (jboolean stream) { + // We might already have been create()d in the nio case. + if (native_fd != -1) + return; + int sock = _Jv_socket (AF_INET, stream ? SOCK_STREAM : SOCK_DGRAM, 0); if (sock < 0) diff --git a/libjava/gnu/java/nio/SocketChannelImpl.java b/libjava/gnu/java/nio/SocketChannelImpl.java index cda86e8..5925712 100644 --- a/libjava/gnu/java/nio/SocketChannelImpl.java +++ b/libjava/gnu/java/nio/SocketChannelImpl.java @@ -1,5 +1,5 @@ /* SocketChannelImpl.java -- - Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -71,6 +71,7 @@ public final class SocketChannelImpl extends SocketChannel { super (provider); impl = new PlainSocketImpl(); + impl.create(true); socket = new NIOSocket (impl, this); configureBlocking(true); } |