apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r749810 - /apr/apr/trunk/file_io/unix/filedup.c
Date Tue, 03 Mar 2009 22:42:54 GMT
Author: bojan
Date: Tue Mar  3 22:42:54 2009
New Revision: 749810

URL: http://svn.apache.org/viewvc?rev=749810&view=rev
Log:
Only set CLOEXEC on dup() if both NOCLEANUP and INHERIT flags are clear.

Modified:
    apr/apr/trunk/file_io/unix/filedup.c

Modified: apr/apr/trunk/file_io/unix/filedup.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/unix/filedup.c?rev=749810&r1=749809&r2=749810&view=diff
==============================================================================
--- apr/apr/trunk/file_io/unix/filedup.c (original)
+++ apr/apr/trunk/file_io/unix/filedup.c Tue Mar  3 22:42:54 2009
@@ -35,12 +35,12 @@
             return APR_EINVAL;
         }
 #ifdef HAVE_DUP3
-        if (!(old_file->flags & APR_INHERIT))
+        if (!(old_file->flags & (APR_FILE_NOCLEANUP|APR_INHERIT)))
             flags |= O_CLOEXEC;
         rv = dup3(old_file->filedes, (*new_file)->filedes, flags);
 #else
         rv = dup2(old_file->filedes, (*new_file)->filedes);
-        if (!(old_file->flags & APR_INHERIT)) {
+        if (!(old_file->flags & (APR_FILE_NOCLEANUP|APR_INHERIT))) {
             int flags;
 
             if (rv == -1)



Mime
View raw message