Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 99932 invoked from network); 24 Aug 2005 15:14:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Aug 2005 15:14:47 -0000 Received: (qmail 59538 invoked by uid 500); 24 Aug 2005 15:14:47 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 59509 invoked by uid 500); 24 Aug 2005 15:14:46 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 59496 invoked by uid 99); 24 Aug 2005 15:14:46 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 24 Aug 2005 08:14:45 -0700 Received: (qmail 99910 invoked by uid 65534); 24 Aug 2005 15:14:45 -0000 Message-ID: <20050824151445.99909.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r239687 - in /apr/apr/trunk: CHANGES threadproc/unix/proc.c Date: Wed, 24 Aug 2005 15:14:45 -0000 To: commits@apr.apache.org From: jorton@apache.org X-Mailer: svnmailer-1.0.3 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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 */