jfclere     2005/04/16 03:31:34

  Modified:    jni/java/org/apache/tomcat/jni Socket.java
               jni/native/src network.c
  Log:
  Throw an exception when bind() failed.
  
  Revision  Changes    Path
  1.7       +3 -2      
jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Socket.java
  
  Index: Socket.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Socket.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Socket.java       15 Apr 2005 10:26:19 -0000      1.6
  +++ Socket.java       16 Apr 2005 10:31:34 -0000      1.7
  @@ -138,7 +138,8 @@
        * This may be where we will find out if there is any other process
        *      using the selected port.
        */
  -    public static native int bind(long sock, long sa);
  +    public static native int bind(long sock, long sa)
  +        throws Exception;
   
       /**
        * Listen to a bound socket for connections.
  
  
  
  1.7       +3 -1      jakarta-tomcat-connectors/jni/native/src/network.c
  
  Index: network.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/src/network.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- network.c 15 Apr 2005 10:26:19 -0000      1.6
  +++ network.c 16 Apr 2005 10:31:34 -0000      1.7
  @@ -135,7 +135,9 @@
       apr_sockaddr_t *a = J2P(sa, apr_sockaddr_t *);
   
       UNREFERENCED_STDARGS;
  -    return (jint)apr_socket_bind(s, a);
  +    TCN_THROW_IF_ERR(apr_socket_bind(s, a), s);
  +cleanup:
  +    return (jint)0;
   }
   
   TCN_IMPLEMENT_CALL(jint, Socket, listen)(TCN_STDARGS, jlong sock,
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to