]> granicus.if.org Git - apache/commitdiff
Improve error reporting a bit so we might start diagnosing any faults
authorWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 24 Jan 2002 06:14:35 +0000 (06:14 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 24 Jan 2002 06:14:35 +0000 (06:14 +0000)
  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

index 7d68cee023ba495f79efef0e9cd95632275f989a..807d9daf9b8b31c9830872d2dc5af74b5266db0f 100644 (file)
@@ -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