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 Tue, 08 Jan 2002 04:24:24 GMT
wrowe       02/01/07 20:24:24

  Modified:    file_io/unix filedup.c
  Log:
    Still, the problem lingers.  There is nothing wrong, AFAICT, with leaving
    fd 0..2 open always.  Otherwise, another process that forks ends up with
    'something else' in fd 2 (or 1, or 0)
  
  Revision  Changes    Path
  1.40      +4 -4      apr/file_io/unix/filedup.c
  
  Index: filedup.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/unix/filedup.c,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- filedup.c	8 Jan 2002 04:17:15 -0000	1.39
  +++ filedup.c	8 Jan 2002 04:24:24 -0000	1.40
  @@ -92,14 +92,14 @@
       /* make sure unget behavior is consistent */
       (*new_file)->ungetchar = old_file->ungetchar;
       /* apr_file_dup() clears the inherit attribute, user must call 
  -     * apr_file_set_inherit() again on the dupped handle, as necessary,
  -     * unless you have dup2'ed fd 0-2 (stdin, stdout or stderr) which
  -     * should never, never, never close on fork()
  +     * apr_file_set_inherit() again on the dupped handle, as necessary.
  +     * If the user has dup2'ed fd 0-2 (stdin, stdout or stderr) we will
  +     * never, never, never close the handle, under any circumstance.
        */
       if (have_file && ((*new_file)->filedes >= 0) && ((*new_file)->filedes
<= 2)) {
           (*new_file)->flags = old_file->flags | APR_INHERIT;
           apr_pool_cleanup_register((*new_file)->cntxt, (void *)(*new_file), 
  -                                  apr_unix_file_cleanup, apr_pool_cleanup_null);
  +                                  apr_pool_cleanup_null, apr_pool_cleanup_null);
       }
       else {
           (*new_file)->flags = old_file->flags & ~APR_INHERIT;
  
  
  

Mime
View raw message