apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r905066 - in /apr/apr/branches/1.4.x: CHANGES file_io/unix/open.c
Date Sun, 31 Jan 2010 16:27:32 GMT
Author: jorton
Date: Sun Jan 31 16:27:32 2010
New Revision: 905066

URL: http://svn.apache.org/viewvc?rev=905066&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

Modified:
    apr/apr/branches/1.4.x/CHANGES
    apr/apr/branches/1.4.x/file_io/unix/open.c

Modified: apr/apr/branches/1.4.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/CHANGES?rev=905066&r1=905065&r2=905066&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/CHANGES [utf-8] (original)
+++ apr/apr/branches/1.4.x/CHANGES [utf-8] Sun Jan 31 16:27:32 2010
@@ -1,7 +1,8 @@
-                                                     -*- coding: utf-8 -*-
+                                                     -*- coding: utf-8 -*-
 Changes for APR 1.4.3
 
-
+  *) Avoid a redundant fcntl() call in apr_file_open() where O_CLOEXEC
+     is supported.  PR 46297.  [Joe Orton]
 
 Changes for APR 1.4.2
 

Modified: apr/apr/branches/1.4.x/file_io/unix/open.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/file_io/unix/open.c?rev=905066&r1=905065&r2=905066&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/file_io/unix/open.c (original)
+++ apr/apr/branches/1.4.x/file_io/unix/open.c Sun Jan 31 16:27:32 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