apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r239687 - in /apr/apr/trunk: CHANGES threadproc/unix/proc.c
Date Wed, 24 Aug 2005 15:14:45 GMT
Author: jorton
Date: Wed Aug 24 08:14:39 2005
New Revision: 239687

URL: http://svn.apache.org/viewcvs?rev=239687&view=rev
Log:
* threadproc/unix/proc.c (apr_proc_create): Use _exit() not exit() to
prevent atexit-registered functions from being run in a failing child,
and e.g. flushing stdio buffers.

PR: 30913

Modified:
    apr/apr/trunk/CHANGES
    apr/apr/trunk/threadproc/unix/proc.c

Modified: apr/apr/trunk/CHANGES
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/CHANGES?rev=239687&r1=239686&r2=239687&view=diff
==============================================================================
--- apr/apr/trunk/CHANGES (original)
+++ apr/apr/trunk/CHANGES Wed Aug 24 08:14:39 2005
@@ -1,5 +1,9 @@
 Changes for APR 1.3.0
 
+  *) If apr_proc_create() fails to exec in the fork()ed child, call
+     _exit() not exit() to avoid running atexit()-registered functions
+     in the child.  PR 30913.  [Joe Orton]
+
   *) Fix error handling where apr_uid_* and apr_gid_* could return
      APR_SUCCESS in failure cases.  [Joe Orton]
 

Modified: apr/apr/trunk/threadproc/unix/proc.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/threadproc/unix/proc.c?rev=239687&r1=239686&r2=239687&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/unix/proc.c (original)
+++ apr/apr/trunk/threadproc/unix/proc.c Wed Aug 24 08:14:39 2005
@@ -419,7 +419,7 @@
                 if (attr->errfn) {
                     attr->errfn(pool, errno, "change of working directory failed");
                 }
-                exit(-1);   /* We have big problems, the child should exit. */
+                _exit(-1);   /* We have big problems, the child should exit. */
             }
         }
 
@@ -429,7 +429,7 @@
                 if (attr->errfn) {
                     attr->errfn(pool, errno, "setting of group failed");
                 }
-                exit(-1);   /* We have big problems, the child should exit. */
+                _exit(-1);   /* We have big problems, the child should exit. */
             }
         }
 
@@ -438,7 +438,7 @@
                 if (attr->errfn) {
                     attr->errfn(pool, errno, "setting of user failed");
                 }
-                exit(-1);   /* We have big problems, the child should exit. */
+                _exit(-1);   /* We have big problems, the child should exit. */
             }
         }
 
@@ -446,7 +446,7 @@
             if (attr->errfn) {
                 attr->errfn(pool, errno, "setting of resource limits failed");
             }
-            exit(-1);   /* We have big problems, the child should exit. */
+            _exit(-1);   /* We have big problems, the child should exit. */
         }
 
         if (attr->cmdtype == APR_SHELLCMD ||
@@ -538,8 +538,8 @@
             attr->errfn(pool, errno, desc);
         }
 
-        exit(-1);  /* if we get here, there is a problem, so exit with an
-                    * error code. */
+        _exit(-1);  /* if we get here, there is a problem, so exit with an
+                     * error code. */
     }
 
     /* Parent process */



Mime
View raw message