]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Follow up to r1526666:
authorJeff Trawick <trawick@apache.org>
Sat, 28 Sep 2013 19:14:25 +0000 (19:14 +0000)
committerJeff Trawick <trawick@apache.org>
Sat, 28 Sep 2013 19:14:25 +0000 (19:14 +0000)
Use SYNCHRONIZE instead of PROCESS_ALL_ACCESS because

a. it is sufficient
b. it avoids an issue where PROCESS_ALL_ACCESS is larger on
   newer SDKs, resulting in a run-time error when running on
   older Windows

Close the handle.

Submitted by: Ivan Zhakov <ivan visualsvn.com>

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

server/mpm/winnt/child.c

index 49b5c2be66efd3f2d76bc6252ac3b61b99940431..fe49b02ebc902b6d75abafcfb0fb6f42dc736309 100644 (file)
@@ -985,11 +985,12 @@ void child_main(apr_pool_t *pconf, DWORD parent_pid)
     child_events[1] = max_requests_per_child_event;
 
     if (parent_pid != my_pid) {
-        child_events[2] = OpenProcess(PROCESS_ALL_ACCESS, FALSE, parent_pid);
+        child_events[2] = OpenProcess(SYNCHRONIZE, FALSE, parent_pid);
         num_events = 3;
     }
     else {
         /* presumably -DONE_PROCESS */
+        child_events[2] = NULL;
         num_events = 2;
     }
 
@@ -1318,6 +1319,9 @@ void child_main(apr_pool_t *pconf, DWORD parent_pid)
 
     apr_pool_destroy(pchild);
     CloseHandle(exit_event);
+    if (child_events[2] != NULL) {
+        CloseHandle(child_events[2]);
+    }
 }
 
 #endif /* def WIN32 */