Return-Path: X-Original-To: apmail-apr-commits-archive@www.apache.org Delivered-To: apmail-apr-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 930929279 for ; Sat, 15 Oct 2011 21:04:58 +0000 (UTC) Received: (qmail 69120 invoked by uid 500); 15 Oct 2011 21:04:58 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 69082 invoked by uid 500); 15 Oct 2011 21:04:58 -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 69075 invoked by uid 99); 15 Oct 2011 21:04:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Oct 2011 21:04:58 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Oct 2011 21:04:57 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 5658A23888FE for ; Sat, 15 Oct 2011 21:04:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1183706 - in /apr/apr/branches/1.5.x: ./ threadproc/unix/proc.c Date: Sat, 15 Oct 2011 21:04:37 -0000 To: commits@apr.apache.org From: sf@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111015210437.5658A23888FE@eris.apache.org> Author: sf Date: Sat Oct 15 21:04:36 2011 New Revision: 1183706 URL: http://svn.apache.org/viewvc?rev=1183706&view=rev Log: Backport r1183685: Don't close any of the new stdin/stdout/stderr FDs in the child if it already has the correct FD. PR: 51995 Submitted by: Dan Ports ] Modified: apr/apr/branches/1.5.x/ (props changed) apr/apr/branches/1.5.x/threadproc/unix/proc.c Propchange: apr/apr/branches/1.5.x/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Oct 15 21:04:36 2011 @@ -1,2 +1,2 @@ /apr/apr/branches/1.4.x:1101301 -/apr/apr/trunk:733052,747990,748361,748371,748565,748888,748902,748988,749810,760443,782838,783398,783958,784633,784773,788588,793192-793193,794118,794485,795267,799497,800627,809745,809854,810472,811455,813063,821306,829490,831641,835607,908427,910419,917819,917837-917838,983618,990435,1055657,1072165,1078845,1183683 +/apr/apr/trunk:733052,747990,748361,748371,748565,748888,748902,748988,749810,760443,782838,783398,783958,784633,784773,788588,793192-793193,794118,794485,795267,799497,800627,809745,809854,810472,811455,813063,821306,829490,831641,835607,908427,910419,917819,917837-917838,983618,990435,1055657,1072165,1078845,1183683,1183685 Modified: apr/apr/branches/1.5.x/threadproc/unix/proc.c URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/threadproc/unix/proc.c?rev=1183706&r1=1183705&r2=1183706&view=diff ============================================================================== --- apr/apr/branches/1.5.x/threadproc/unix/proc.c (original) +++ apr/apr/branches/1.5.x/threadproc/unix/proc.c Sat Oct 15 21:04:36 2011 @@ -432,7 +432,8 @@ APR_DECLARE(apr_status_t) apr_proc_creat if ((attr->child_in) && (attr->child_in->filedes == -1)) { close(STDIN_FILENO); } - else if (attr->child_in) { + else if (attr->child_in && + attr->child_in->filedes != STDIN_FILENO) { dup2(attr->child_in->filedes, STDIN_FILENO); apr_file_close(attr->child_in); } @@ -440,7 +441,8 @@ APR_DECLARE(apr_status_t) apr_proc_creat if ((attr->child_out) && (attr->child_out->filedes == -1)) { close(STDOUT_FILENO); } - else if (attr->child_out) { + else if (attr->child_out && + attr->child_out->filedes != STDOUT_FILENO) { dup2(attr->child_out->filedes, STDOUT_FILENO); apr_file_close(attr->child_out); } @@ -448,7 +450,8 @@ APR_DECLARE(apr_status_t) apr_proc_creat if ((attr->child_err) && (attr->child_err->filedes == -1)) { close(STDERR_FILENO); } - else if (attr->child_err) { + else if (attr->child_err && + attr->child_err->filedes != STDERR_FILENO) { dup2(attr->child_err->filedes, STDERR_FILENO); apr_file_close(attr->child_err); }