apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r905308 - /apr/apr/branches/1.5.x/file_io/unix/open.c
Date Mon, 01 Feb 2010 15:33:11 GMT
Author: trawick
Date: Mon Feb  1 15:33:11 2010
New Revision: 905308

URL: http://svn.apache.org/viewvc?rev=905308&view=rev
Log:
Merge r905040 from trunk:

* file_io/unix/open.c (apr_file_open): Don't set FD_CLOEXEC if it was
  already set via O_CLOEXEC.

PR: 46297

Submitted by: jorton


Modified:
    apr/apr/branches/1.5.x/file_io/unix/open.c

Modified: apr/apr/branches/1.5.x/file_io/unix/open.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/file_io/unix/open.c?rev=905308&r1=905307&r2=905308&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/file_io/unix/open.c (original)
+++ apr/apr/branches/1.5.x/file_io/unix/open.c Mon Feb  1 15:33:11 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