apr-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=905067&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.3.x/   (props changed)
    apr/apr/branches/1.3.x/CHANGES
    apr/apr/branches/1.3.x/file_io/unix/open.c

Propchange: apr/apr/branches/1.3.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jan 31 16:29:27 2010
@@ -1,2 +1,2 @@
 /apr/apr/branches/1.4.x:783970
-/apr/apr/trunk:712674,733052,742752,747990,748361,748371,748565,748988,749810,782838,783398,783958,788588,794485,795267,799497,800627,809854,829490,831641
+/apr/apr/trunk:712674,733052,742752,747990,748361,748371,748565,748988,749810,782838,783398,783958,788588,794485,795267,799497,800627,809854,829490,831641,905040

Modified: apr/apr/branches/1.3.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/CHANGES?rev=905067&r1=905066&r2=905067&view=diff
==============================================================================
--- apr/apr/branches/1.3.x/CHANGES [utf-8] (original)
+++ apr/apr/branches/1.3.x/CHANGES [utf-8] Sun Jan 31 16:29:27 2010
@@ -1,6 +1,9 @@
-                                                     -*- coding: utf-8 -*-
+                                                     -*- coding: utf-8 -*-
 Changes for APR 1.3.10
 
+  *) Avoid a redundant fcntl() call in apr_file_open() where O_CLOEXEC
+     is supported.  PR 46297.  [Joe Orton]
+
   *) Solaris 10 and later: Change the default cross-mutex mechanism from
      fcntl to pthread to resolve EDEADLK failures with some multi-threaded,
      multi-process applications (e.g., httpd's worker MPM with certain

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