aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/net
diff options
context:
space:
mode:
authorNoa Resare <noa@resare.com>2004-11-06 16:49:56 +0000
committerMark Wielaard <mark@gcc.gnu.org>2004-11-06 16:49:56 +0000
commit8d43449beeca514721c7bc676fe7b5879810ca42 (patch)
treede90822502a015d0faf60f36ac524a12ea7ff903 /libjava/java/net
parentc2e999dfeb7680617c0febb42299ebfac01a6bf7 (diff)
downloadgcc-8d43449beeca514721c7bc676fe7b5879810ca42.zip
gcc-8d43449beeca514721c7bc676fe7b5879810ca42.tar.gz
gcc-8d43449beeca514721c7bc676fe7b5879810ca42.tar.bz2
Socket.java (getPort): Return 0 instead of -1 on unconnected sockets.
2004-11-06 Noa Resare <noa@resare.com> * java/net/Socket.java (getPort): Return 0 instead of -1 on unconnected sockets. From-SVN: r90178
Diffstat (limited to 'libjava/java/net')
-rw-r--r--libjava/java/net/Socket.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/libjava/java/net/Socket.java b/libjava/java/net/Socket.java
index bebd73d..8d35fe3 100644
--- a/libjava/java/net/Socket.java
+++ b/libjava/java/net/Socket.java
@@ -520,14 +520,14 @@ public class Socket
/**
* Returns the port number of the remote end of the socket connection. If
- * this socket is not connected, then -1 is returned.
+ * this socket is not connected, then 0 is returned.
*
* @return The remote port this socket is connected to
*/
public int getPort()
{
if (! isConnected())
- return -1;
+ return 0;
try
{