apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r905040 - /apr/apr/trunk/file_io/unix/open.c
Date Sun, 31 Jan 2010 13:46:16 GMT
Author: jorton
Date: Sun Jan 31 13:46:16 2010
New Revision: 905040

URL: http://svn.apache.org/viewvc?rev=905040&view=rev
Log:
* file_io/unix/open.c (apr_file_open): Don't set FD_CLOEXEC if it was
  already set via O_CLOEXEC.

PR: 46297

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

Modified: apr/apr/trunk/file_io/unix/open.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/unix/open.c?rev=905040&r1=905039&r2=905040&view=diff
==============================================================================
--- apr/apr/trunk/file_io/unix/open.c (original)
+++ apr/apr/trunk/file_io/unix/open.c Sun Jan 31 13:46:16 2010
@@ -176,9 +176,11 @@
         if ((flags = fcntl(fd, F_GETFD)) == -1)
             return errno;
 
-        flags |= FD_CLOEXEC;
-        if (fcntl(fd, F_SETFD, flags) == -1)
-            return errno;
+        if ((flags & FD_CLOEXEC) == 0) {
+            flags |= FD_CLOEXEC;
+            if (fcntl(fd, F_SETFD, flags) == -1)
+                return errno;
+        }
     }
 
     (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t));



Mime
View raw message