]> granicus.if.org Git - apache/commitdiff
Win32: Handles returned by GetStdHandle are psuedo handles and should never be
authorBill Stoddard <stoddard@apache.org>
Mon, 11 Feb 2002 15:46:44 +0000 (15:46 +0000)
committerBill Stoddard <stoddard@apache.org>
Mon, 11 Feb 2002 15:46:44 +0000 (15:46 +0000)
passed to a CloseHandle call.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93361 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/winnt/mpm_winnt.c

index 1a954bf137fa034ba73fb2fce70d48c56f4afca8..d08c7447a7abdc5886bbed803f24b9e043703807 100644 (file)
@@ -1600,7 +1600,12 @@ static int create_process(apr_pool_t *p, HANDLE *child_proc, HANDLE *child_exit_
     CloseHandle(pi.hThread);
     CloseHandle(hPipeRead);
     CloseHandle(hNullOutput);
-    CloseHandle(hShareError);
+    if (GetStdHandle(STD_ERROR_HANDLE) != hShareError) {
+        /* Handles opened with GetStdHandle are psuedo handles
+         * and should not be closed else bad things will happen.
+         */
+        CloseHandle(hShareError);
+    }
     _putenv("AP_PARENT_PID=");
     _putenv("AP_MY_GENERATION=");