]> granicus.if.org Git - apache/blobdiff - server/mpm_common.c
mpm-query hook: distinguish between DECLINED and APR_ENOTIMPL so that
[apache] / server / mpm_common.c
index 2d365434b84d24eca3c8d4124b1c535b1f2c7722..59e175306f00d1f3a694ffa5bda6fb649652aab6 100644 (file)
@@ -63,7 +63,6 @@ APR_HOOK_STRUCT(
     APR_HOOK_LINK(drop_privileges)
     APR_HOOK_LINK(mpm)
     APR_HOOK_LINK(mpm_query)
-    APR_HOOK_LINK(mpm_get_child_pid)
     APR_HOOK_LINK(mpm_note_child_killed)
     APR_HOOK_LINK(mpm_register_timed_callback)
     APR_HOOK_LINK(mpm_get_name)
@@ -76,7 +75,6 @@ APR_HOOK_STRUCT(
     APR_HOOK_LINK(drop_privileges)
     APR_HOOK_LINK(mpm)
     APR_HOOK_LINK(mpm_query)
-    APR_HOOK_LINK(mpm_get_child_pid)
     APR_HOOK_LINK(mpm_note_child_killed)
     APR_HOOK_LINK(mpm_register_timed_callback)
     APR_HOOK_LINK(mpm_get_name)
@@ -90,12 +88,9 @@ AP_IMPLEMENT_HOOK_RUN_ALL(int, drop_privileges,
 AP_IMPLEMENT_HOOK_RUN_FIRST(int, mpm,
                             (apr_pool_t *pconf, apr_pool_t *plog, server_rec *s),
                             (pconf, plog, s), DECLINED)
-AP_IMPLEMENT_HOOK_RUN_FIRST(apr_status_t, mpm_query,
-                            (int query_code, int *result),
-                            (query_code, result), APR_ENOTIMPL)
-AP_IMPLEMENT_HOOK_RUN_FIRST(pid_t, mpm_get_child_pid,
-                            (int childnum),
-                            (childnum), 0)
+AP_IMPLEMENT_HOOK_RUN_FIRST(int, mpm_query,
+                            (int query_code, int *result, apr_status_t *_rv),
+                            (query_code, result, _rv), DECLINED)
 AP_IMPLEMENT_HOOK_RUN_FIRST(apr_status_t, mpm_note_child_killed,
                             (int childnum),
                             (childnum), APR_ENOTIMPL)
@@ -410,12 +405,13 @@ AP_DECLARE(int) ap_mpm_run(apr_pool_t *pconf, apr_pool_t *plog, server_rec *serv
 
 AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
 {
-    return ap_run_mpm_query(query_code, result);
-}
+    apr_status_t rv;
 
-AP_DECLARE(pid_t) ap_mpm_get_child_pid(int childnum)
-{
-    return ap_run_mpm_get_child_pid(childnum);
+    if (ap_run_mpm_query(query_code, result, &rv) == DECLINED) {
+        rv = APR_EGENERAL;
+    }
+
+    return rv;
 }
 
 AP_DECLARE(apr_status_t) ap_mpm_note_child_killed(int childnum)