classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fwd: [Jamvm-general] Problem with sockets on JamVM version 1.3.3 an


From: Mark Wielaard
Subject: Re: [Fwd: [Jamvm-general] Problem with sockets on JamVM version 1.3.3 and Classpath 0.18]
Date: Mon, 19 Sep 2005 12:36:52 +0200

Hi,

On Sun, 2005-09-18 at 15:43 -0600, Tom Tromey wrote:
> I looked through our networking code and a few more places have this
> problem:
> 
> * javanet.c: _javanet_shutdownInput, _javanet_shutdownOutput
> 
> * java_net_VMInetAddress.c: Java_java_net_VMInetAddress_getHostByAddr
>   Java_java_net_VMInetAddress_getHostByName

Lets fix those immediately so future bug reports come with a little more
info.

2005-09-19  Mark Wielaard  <address@hidden>

        * native/jni/java-net/java_net_VMInetAddress.c
        (Java_java_net_VMInetAddress_getHostByAddr): Add error string as
        exception message.
        * native/jni/java-net/javanet.c (_javanet_accept): Likewise.
        (_javanet_shutdownInput): Likewise.
        (_javanet_shutdownOutput): Likewise.

There don't seem to be target native functions for shutdown, so I just
used the normal errno value there.

Committed,

Mark
Index: native/jni/java-net/java_net_VMInetAddress.c
===================================================================
RCS file: 
/cvsroot/classpath/classpath/native/jni/java-net/java_net_VMInetAddress.c,v
retrieving revision 1.2
diff -u -r1.2 java_net_VMInetAddress.c
--- native/jni/java-net/java_net_VMInetAddress.c        2 Jul 2005 20:32:55 
-0000       1.2
+++ native/jni/java-net/java_net_VMInetAddress.c        19 Sep 2005 10:36:01 
-0000
@@ -181,7 +181,8 @@
                                                 sizeof (hostname), result);
   if (result != TARGET_NATIVE_OK)
     {
-      JCL_ThrowException (env, UNKNOWN_HOST_EXCEPTION, "Bad IP address");
+      JCL_ThrowException (env, UNKNOWN_HOST_EXCEPTION,
+                         TARGET_NATIVE_LAST_ERROR_STRING ());
       return (jstring) NULL;
     }
 
Index: native/jni/java-net/javanet.c
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/java-net/javanet.c,v
retrieving revision 1.23
diff -u -r1.23 javanet.c
--- native/jni/java-net/javanet.c       11 Jul 2005 18:23:06 -0000      1.23
+++ native/jni/java-net/javanet.c       19 Sep 2005 10:36:01 -0000
@@ -857,7 +857,7 @@
              != TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL))
        {
          JCL_ThrowException (env, IO_EXCEPTION,
-                             "Internal error: _javanet_accept(): ");
+                             TARGET_NATIVE_LAST_ERROR_STRING ());
          return;
        }
     }
@@ -1542,8 +1542,7 @@
   /* Shutdown input stream of socket. */
   if (shutdown (fd, SHUT_RD) == -1)
     {
-      JCL_ThrowException (env, SOCKET_EXCEPTION,
-                         "Can't shutdown input of socket");
+      JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
       return;
     }
 }
@@ -1568,8 +1567,7 @@
   /* Shutdown output stream of socket. */
   if (shutdown (fd, SHUT_WR) == -1)
     {
-      JCL_ThrowException (env, SOCKET_EXCEPTION,
-                         "Can't shutdown output of socket");
+      JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
       return;
     }
 }

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]