mturk       2005/08/01 00:08:55

  Modified:    jni/java/org/apache/tomcat/jni File.java
               jni/native/src file.c
  Log:
  Fix dup2 implementation.
  
  Revision  Changes    Path
  1.7       +4 -5      
jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/File.java
  
  Index: File.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/File.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- File.java 12 Jul 2005 14:56:09 -0000      1.6
  +++ File.java 1 Aug 2005 07:08:55 -0000       1.7
  @@ -671,15 +671,14 @@
           throws Error;
   
       /**
  -     * Duplicate the specified file descriptor.
  +     * Duplicate the specified file descriptor and close the original.
        * @param newFile The old file that is to be closed and reused.
        * newFile MUST point at a valid apr_file_t. It cannot be NULL.
        * @param oldFile The file to duplicate.
        * @param pool The pool to use for the new file.
  -     * @return Duplicated file structure.
  +     * @return Status code.
        */
  -    public static native long dup2(long newFile, long oldFile, long pool)
  -        throws Error;
  +    public static native int dup2(long newFile, long oldFile, long pool)
   
       /**
        * Get the specified file's stats.  The file is specified by filename,
  
  
  
  1.11      +5 -8      jakarta-tomcat-connectors/jni/native/src/file.c
  
  Index: file.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/src/file.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- file.c    1 Aug 2005 06:59:48 -0000       1.10
  +++ file.c    1 Aug 2005 07:08:55 -0000       1.11
  @@ -589,16 +589,13 @@
       return P2J(d);
   }
   
  -TCN_IMPLEMENT_CALL(jlong, File, dup2)(TCN_STDARGS, jlong newf, jlong file,
  -                                      jlong pool)
  +TCN_IMPLEMENT_CALL(jint, File, dup2)(TCN_STDARGS, jlong newf, jlong file,
  +                                     jlong pool)
   {
       apr_file_t *f = J2P(file, apr_file_t *);
       apr_pool_t *p = J2P(pool, apr_pool_t *);
       apr_file_t *d = J2P(newf, apr_file_t *);
   
  -    UNREFERENCED(o);
  -    TCN_THROW_IF_ERR(apr_file_dup2(&d, f, p), d);
  -
  -cleanup:
  -    return P2J(d);
  +    UNREFERENCED_STDARGS;
  +    return (jint)apr_file_dup2(d, f, p);
   }
  
  
  

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

Reply via email to