apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/file_io/unix filedup.c
Date Wed, 19 Mar 2003 02:08:29 GMT
wrowe       2003/03/18 18:08:29

  Modified:    file_io/unix filedup.c
  Log:
    Bug Fix #1 .. Move the special-case of Netware into _dup_file() where
    it belongs (this will be evident in bug #2).  The patch fixes a fd
    leak on Netware where each call to apr_file_dup2 failed to close the
    original fd.
  
  Revision  Changes    Path
  1.54      +8 -4      apr/file_io/unix/filedup.c
  
  Index: filedup.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/unix/filedup.c,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- filedup.c	7 Jan 2003 00:52:53 -0000	1.53
  +++ filedup.c	19 Mar 2003 02:08:28 -0000	1.54
  @@ -78,7 +78,15 @@
       }
   
       if (which_dup == 2) {
  +#ifdef NETWARE
  +        /* Apparently Netware doesn't support dup2... instead
  +         * close() then dup()
  +         */
  +        close((*new_file)->filedes);
  +        rv = ((*new_file)->filedes = dup(old_file->filedes)); 
  +#else
           rv = dup2(old_file->filedes, (*new_file)->filedes);
  +#endif
       } else {
           rv = ((*new_file)->filedes = dup(old_file->filedes)); 
       }
  @@ -141,11 +149,7 @@
   APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file,
                                           apr_file_t *old_file, apr_pool_t *p)
   {
  -#ifdef NETWARE
  -    return _file_dup(&new_file, old_file, p, 1);
  -#else
       return _file_dup(&new_file, old_file, p, 2);
  -#endif
   }
   
   APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file,
  
  
  

Mime
View raw message