From ec1a9c595c61ef47a9668fb53fdaee2a9666ddc3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 24 Jan 2002 06:14:35 +0000 Subject: [PATCH] Improve error reporting a bit so we might start diagnosing any faults that might be introduced. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92995 13f79535-47bb-0310-9956-ffa450edef68 --- server/mpm/winnt/mpm_winnt.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index 7d68cee023..807d9daf9b 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -671,11 +671,6 @@ static PCOMP_CONTEXT win9x_get_connection(PCOMP_CONTEXT context) if (context == NULL) { /* allocate the completion context and the transaction pool */ context = apr_pcalloc(pconf, sizeof(COMP_CONTEXT)); - if (!context) { - ap_log_error(APLOG_MARK,APLOG_ERR, apr_get_os_error(), ap_server_conf, - "win9x_get_connection: apr_pcalloc() failed. Process will exit."); - return NULL; - } apr_pool_create(&context->ptrans, pconf); } @@ -1291,20 +1286,22 @@ static int create_process(apr_pool_t *p, HANDLE *child_proc, HANDLE *child_exit_ /* Make our end of the handle non-inherited */ if (DuplicateHandle(hCurrentProcess, hPipeWrite, hCurrentProcess, - &hPipeWriteDup, 0, FALSE, DUPLICATE_SAME_ACCESS)) - { + &hPipeWriteDup, 0, FALSE, DUPLICATE_SAME_ACCESS)) { CloseHandle(hPipeWrite); hPipeWrite = hPipeWriteDup; } + else { + ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf, + "Parent: Unable to duplicate pipe to child.\n"); + } /* Open a null handle to soak info from the child */ hNullOutput = CreateFile("nul", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, &sa, OPEN_EXISTING, 0, NULL); if (hNullOutput == INVALID_HANDLE_VALUE) { - ap_log_error(APLOG_MARK, APLOG_CRIT, APR_FROM_OS_ERROR(rv), ap_server_conf, + ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(), ap_server_conf, "Parent: Unable to create null output pipe for child process.\n"); - return -1; } /* Child's initial stderr -> our main server error log (or, failing that, stderr) */ @@ -1320,9 +1317,18 @@ static int create_process(apr_pool_t *p, HANDLE *child_proc, HANDLE *child_exit_ rv = apr_get_os_error(); } } - if (rv != APR_SUCCESS || hShareError == INVALID_HANDLE_VALUE) { + if (rv != APR_SUCCESS) { + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf, + "Parent: Unable to share error log with child.\n"); + } + else if (hShareError == INVALID_HANDLE_VALUE) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_CRIT, 0, ap_server_conf, + "Parent: Failed to share error log with child.\n"); + } + else { hShareError = GetStdHandle(STD_ERROR_HANDLE); } + } /* Give the read end of the pipe (hPipeRead) to the child as stdin. The -- 2.40.0