From commits-return-8737-apmail-apr-commits-archive=apr.apache.org@apr.apache.org Fri Oct 05 02:10:46 2007 Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 87984 invoked from network); 5 Oct 2007 02:10:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Oct 2007 02:10:45 -0000 Received: (qmail 33985 invoked by uid 500); 5 Oct 2007 02:10:33 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 33949 invoked by uid 500); 5 Oct 2007 02:10:33 -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 33938 invoked by uid 99); 5 Oct 2007 02:10:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2007 19:10:33 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Oct 2007 02:10:35 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 78BB91A9832; Thu, 4 Oct 2007 19:10:15 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r582056 - in /apr/apr/branches/1.2.x: CHANGES include/apr_thread_proc.h threadproc/win32/proc.c Date: Fri, 05 Oct 2007 02:10:15 -0000 To: commits@apr.apache.org From: wrowe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071005021015.78BB91A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: wrowe Date: Thu Oct 4 19:10:14 2007 New Revision: 582056 URL: http://svn.apache.org/viewvc?rev=582056&view=rev Log: Revert to 1.2.8 behavior of apr_proc_create and reintroduce the httpd rotatelogs bug on windows. Behavior fix vetoed by Joe Orton, Paul Querna Modified: apr/apr/branches/1.2.x/CHANGES apr/apr/branches/1.2.x/include/apr_thread_proc.h apr/apr/branches/1.2.x/threadproc/win32/proc.c Modified: apr/apr/branches/1.2.x/CHANGES URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/CHANGES?rev=582056&r1=582055&r2=582056&view=diff ============================================================================== --- apr/apr/branches/1.2.x/CHANGES [utf-8] (original) +++ apr/apr/branches/1.2.x/CHANGES [utf-8] Thu Oct 4 19:10:14 2007 @@ -4,16 +4,15 @@ *) Cause apr_file_dup2() on Win32 to update the MSVCRT psuedo-stdio handles for fd-based and FILE * based I/O. [William Rowe] - *) Introduce APR_NO_FILE as an option to apr_procattr_io_set() for any - of the three stdio streams to cause the corresponding streams to NOT - be inherited to a WIN32 child process (passes INVALID_HANDLE_VALUE). - This is of little importance to most developers, except those who had - exploited an inconsistency between Unix and Win32 that was corrected - on Win32 with APR version 1.2.10. The feature to have NO_FILE work - across platforms and leave a specified std stream closed becomes - portable in APR version 1.3.0 (it remains equivilant to APR_NO_PIPE - on non-Windows platforms throughout version APR 1.2.x). - [William Rowe] + *) Revert Win32 to the 1.2.8 behavior of apr_proc_create() for any + of the three stdio streams which are not initialized, through either + apr_procattr_io_set() or apr_procattr_stdXXX_set(), when given a + procattr_t with one or two streams which were initialized through + apr_procattr_stdXXX_set(). Once again, these do not inherit the + parent process stdio stream to WIN32 child processes (passing + INVALID_HANDLE_VALUE instead) as on Unix. Note APR 1.3.0 adopts + the unix behavior of inheriting any uninitialed streams as the + parent's corresponding stdio stream, in such cases. [William Rowe] Changes for APR 1.2.11 Modified: apr/apr/branches/1.2.x/include/apr_thread_proc.h URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/include/apr_thread_proc.h?rev=582056&r1=582055&r2=582056&view=diff ============================================================================== --- apr/apr/branches/1.2.x/include/apr_thread_proc.h (original) +++ apr/apr/branches/1.2.x/include/apr_thread_proc.h Thu Oct 4 19:10:14 2007 @@ -87,15 +87,6 @@ /** @see apr_procattr_io_set */ #define APR_CHILD_BLOCK 4 -/** @see apr_procattr_io_set - * @note introduced strictly for Win32 to apr revision 1.2.12 (to restore - * the non-portable default behavior of 1.2.9 and prior versions on Win32). - * This becomes portable to all platforms effective revision 1.3.0, ensuring - * the standard files specified in the call to apr_procattr_io_set are not - * open in the created process (on Win32 as INVALID_HANDLE_VALUEs). - */ -#define APR_NO_FILE 8 - /** @see apr_procattr_limit_set */ #define APR_LIMIT_CPU 0 /** @see apr_procattr_limit_set */ Modified: apr/apr/branches/1.2.x/threadproc/win32/proc.c URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/threadproc/win32/proc.c?rev=582056&r1=582055&r2=582056&view=diff ============================================================================== --- apr/apr/branches/1.2.x/threadproc/win32/proc.c (original) +++ apr/apr/branches/1.2.x/threadproc/win32/proc.c Thu Oct 4 19:10:14 2007 @@ -32,11 +32,6 @@ #include #endif -/* Heavy on no'ops, here's what we want to pass if there is APR_NO_FILE - * requested for a specific child handle; - */ -static apr_file_t no_file = { NULL, INVALID_HANDLE_VALUE, }; - /* We have very carefully excluded volumes of definitions from the * Microsoft Platform SDK, which kill the build time performance. * These the sole constants we borrow from WinBase.h and WinUser.h @@ -93,29 +88,20 @@ else if (in == APR_PARENT_BLOCK) in = APR_WRITE_BLOCK; - if (in == APR_NO_FILE) - attr->child_in = &no_file; - else - stat = apr_create_nt_pipe(&attr->child_in, &attr->parent_in, - in, attr->pool); + stat = apr_create_nt_pipe(&attr->child_in, &attr->parent_in, + in, attr->pool); if (stat == APR_SUCCESS) stat = apr_file_inherit_unset(attr->parent_in); } if (out && stat == APR_SUCCESS) { - if (out == APR_NO_FILE) - attr->child_out = &no_file; - else - stat = apr_create_nt_pipe(&attr->parent_out, &attr->child_out, - out, attr->pool); + stat = apr_create_nt_pipe(&attr->parent_out, &attr->child_out, + out, attr->pool); if (stat == APR_SUCCESS) stat = apr_file_inherit_unset(attr->parent_out); } if (err && stat == APR_SUCCESS) { - if (err == APR_NO_FILE) - attr->child_err = &no_file; - else - stat = apr_create_nt_pipe(&attr->parent_err, &attr->child_err, - err, attr->pool); + stat = apr_create_nt_pipe(&attr->parent_err, &attr->child_err, + err, attr->pool); if (stat == APR_SUCCESS) stat = apr_file_inherit_unset(attr->parent_err); } @@ -129,7 +115,7 @@ apr_status_t rv = APR_SUCCESS; if (child_in) { - if ((attr->child_in == NULL) || (attr->child_in == &no_file)) + if (attr->child_in == NULL) rv = apr_file_dup(&attr->child_in, child_in, attr->pool); else rv = apr_file_dup2(attr->child_in, child_in, attr->pool); @@ -155,7 +141,7 @@ apr_status_t rv = APR_SUCCESS; if (child_out) { - if ((attr->child_out == NULL) || (attr->child_out == &no_file)) + if (attr->child_out == NULL) rv = apr_file_dup(&attr->child_out, child_out, attr->pool); else rv = apr_file_dup2(attr->child_out, child_out, attr->pool); @@ -181,7 +167,7 @@ apr_status_t rv = APR_SUCCESS; if (child_err) { - if ((attr->child_err == NULL) || (attr->child_err == &no_file)) + if (attr->child_err == NULL) rv = apr_file_dup(&attr->child_err, child_err, attr->pool); else rv = apr_file_dup2(attr->child_err, child_err, attr->pool); @@ -795,49 +781,49 @@ si.dwFlags |= STARTF_USESTDHANDLES; si.hStdInput = GetStdHandle(STD_INPUT_HANDLE); + if (GetHandleInformation(si.hStdInput, &stdin_reset) + && (stdin_reset &= HANDLE_FLAG_INHERIT)) + SetHandleInformation(si.hStdInput, + HANDLE_FLAG_INHERIT, 0); + if (attr->child_in && attr->child_in->filehand) { - if (GetHandleInformation(si.hStdInput, - &stdin_reset) - && (stdin_reset &= HANDLE_FLAG_INHERIT)) - SetHandleInformation(si.hStdInput, - HANDLE_FLAG_INHERIT, 0); - - if ( (si.hStdInput = attr->child_in->filehand) - != INVALID_HANDLE_VALUE ) - SetHandleInformation(si.hStdInput, HANDLE_FLAG_INHERIT, - HANDLE_FLAG_INHERIT); + si.hStdInput = attr->child_in->filehand; + SetHandleInformation(si.hStdInput, HANDLE_FLAG_INHERIT, + HANDLE_FLAG_INHERIT); } + else + si.hStdInput = INVALID_HANDLE_VALUE; si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); + if (GetHandleInformation(si.hStdOutput, &stdout_reset) + && (stdout_reset &= HANDLE_FLAG_INHERIT)) + SetHandleInformation(si.hStdOutput, + HANDLE_FLAG_INHERIT, 0); + if (attr->child_out && attr->child_out->filehand) { - if (GetHandleInformation(si.hStdOutput, - &stdout_reset) - && (stdout_reset &= HANDLE_FLAG_INHERIT)) - SetHandleInformation(si.hStdOutput, - HANDLE_FLAG_INHERIT, 0); - - if ( (si.hStdOutput = attr->child_out->filehand) - != INVALID_HANDLE_VALUE ) - SetHandleInformation(si.hStdOutput, HANDLE_FLAG_INHERIT, - HANDLE_FLAG_INHERIT); + si.hStdOutput = attr->child_out->filehand; + SetHandleInformation(si.hStdOutput, HANDLE_FLAG_INHERIT, + HANDLE_FLAG_INHERIT); } + else + si.hStdOutput = INVALID_HANDLE_VALUE; si.hStdError = GetStdHandle(STD_ERROR_HANDLE); + if (GetHandleInformation(si.hStdError, &stderr_reset) + && (stderr_reset &= HANDLE_FLAG_INHERIT)) + SetHandleInformation(si.hStdError, + HANDLE_FLAG_INHERIT, 0); + if (attr->child_err && attr->child_err->filehand) { - if (GetHandleInformation(si.hStdError, - &stderr_reset) - && (stderr_reset &= HANDLE_FLAG_INHERIT)) - SetHandleInformation(si.hStdError, - HANDLE_FLAG_INHERIT, 0); - - if ( (si.hStdError = attr->child_err->filehand) - != INVALID_HANDLE_VALUE ) - SetHandleInformation(si.hStdError, HANDLE_FLAG_INHERIT, + si.hStdError = attr->child_err->filehand; + SetHandleInformation(si.hStdError, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT); } + else + si.hStdError = INVALID_HANDLE_VALUE; } if (attr->user_token) { /* XXX: for terminal services, handles can't be cannot be @@ -959,13 +945,13 @@ new->hproc = pi.hProcess; new->pid = pi.dwProcessId; - if ((attr->child_in) && (attr->child_in != &no_file)) { + if (attr->child_in) { apr_file_close(attr->child_in); } - if ((attr->child_out) && (attr->child_out != &no_file)) { + if (attr->child_out) { apr_file_close(attr->child_out); } - if ((attr->child_err) && (attr->child_err != &no_file)) { + if (attr->child_err) { apr_file_close(attr->child_err); } CloseHandle(pi.hThread);