summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2009-03-29 19:30:17 +0000
committerJeff Trawick <trawick@apache.org>2009-03-29 19:30:17 +0000
commit35e3599b25f9331d242420b3ffb1dd54af755e0c (patch)
treed3035ca797568eb701f29711fce2b705ebc6ec6c /server
parent2103ba72a12bfee57ddae88edcef71473cb2e61a (diff)
downloadhttpd-35e3599b25f9331d242420b3ffb1dd54af755e0c.tar.gz
the mpm_get_child_pid hook is unnecessary, as was the per-MPM MPM_CHILD_PID() macro which it replaced
axe this new hook, and use ap_get_scoreboard_process() instead git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759757 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r--server/mpm/event/event.c6
-rw-r--r--server/mpm/prefork/prefork.c6
-rw-r--r--server/mpm/worker/worker.c6
-rw-r--r--server/mpm_common.c10
-rw-r--r--server/mpm_unix.c7
5 files changed, 5 insertions, 30 deletions
diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c
index 71c7bd90fb..e6299092d2 100644
--- a/server/mpm/event/event.c
+++ b/server/mpm/event/event.c
@@ -404,11 +404,6 @@ static apr_status_t event_query(int query_code, int *result)
return APR_ENOTIMPL;
}
-static pid_t event_get_child_pid(int childnum)
-{
- return ap_scoreboard_image->parent[childnum].pid;
-}
-
static apr_status_t event_note_child_killed(int childnum)
{
ap_scoreboard_image->parent[childnum].pid = 0;
@@ -2744,7 +2739,6 @@ static void event_hooks(apr_pool_t * p)
ap_hook_check_config(event_check_config, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm(event_run, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm_query(event_query, NULL, NULL, APR_HOOK_MIDDLE);
- ap_hook_mpm_get_child_pid(event_get_child_pid, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm_note_child_killed(event_note_child_killed, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm_register_timed_callback(event_register_timed_callback, NULL, NULL,
APR_HOOK_MIDDLE);
diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c
index 553355deac..9f65a754b7 100644
--- a/server/mpm/prefork/prefork.c
+++ b/server/mpm/prefork/prefork.c
@@ -291,11 +291,6 @@ static apr_status_t prefork_query(int query_code, int *result)
return APR_ENOTIMPL;
}
-static pid_t prefork_get_child_pid(int childnum)
-{
- return ap_scoreboard_image->parent[childnum].pid;
-}
-
static apr_status_t prefork_note_child_killed(int childnum)
{
ap_scoreboard_image->parent[childnum].pid = 0;
@@ -1458,7 +1453,6 @@ static void prefork_hooks(apr_pool_t *p)
ap_hook_check_config(prefork_check_config, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm(prefork_run, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm_query(prefork_query, NULL, NULL, APR_HOOK_MIDDLE);
- ap_hook_mpm_get_child_pid(prefork_get_child_pid, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm_note_child_killed(prefork_note_child_killed, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm_get_name(prefork_get_name, NULL, NULL, APR_HOOK_MIDDLE);
}
diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c
index f486c9762e..8f502b26e3 100644
--- a/server/mpm/worker/worker.c
+++ b/server/mpm/worker/worker.c
@@ -354,11 +354,6 @@ static apr_status_t worker_query(int query_code, int *result)
return APR_ENOTIMPL;
}
-static pid_t worker_get_child_pid(int childnum)
-{
- return ap_scoreboard_image->parent[childnum].pid;
-}
-
static apr_status_t worker_note_child_killed(int childnum)
{
ap_scoreboard_image->parent[childnum].pid = 0;
@@ -2245,7 +2240,6 @@ static void worker_hooks(apr_pool_t *p)
ap_hook_check_config(worker_check_config, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm(worker_run, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm_query(worker_query, NULL, NULL, APR_HOOK_MIDDLE);
- ap_hook_mpm_get_child_pid(worker_get_child_pid, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm_note_child_killed(worker_note_child_killed, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm_get_name(worker_get_name, NULL, NULL, APR_HOOK_MIDDLE);
}
diff --git a/server/mpm_common.c b/server/mpm_common.c
index 2d365434b8..597e388960 100644
--- a/server/mpm_common.c
+++ b/server/mpm_common.c
@@ -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)
@@ -93,9 +91,6 @@ AP_IMPLEMENT_HOOK_RUN_FIRST(int, mpm,
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(apr_status_t, mpm_note_child_killed,
(int childnum),
(childnum), APR_ENOTIMPL)
@@ -413,11 +408,6 @@ AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
return ap_run_mpm_query(query_code, result);
}
-AP_DECLARE(pid_t) ap_mpm_get_child_pid(int childnum)
-{
- return ap_run_mpm_get_child_pid(childnum);
-}
-
AP_DECLARE(apr_status_t) ap_mpm_note_child_killed(int childnum)
{
return ap_run_mpm_note_child_killed(childnum);
diff --git a/server/mpm_unix.c b/server/mpm_unix.c
index d3137776c3..3333e18fe9 100644
--- a/server/mpm_unix.c
+++ b/server/mpm_unix.c
@@ -42,6 +42,7 @@
#include "mpm_common.h"
#include "ap_mpm.h"
#include "ap_listen.h"
+#include "scoreboard.h"
#include "util_mutex.h"
#ifdef HAVE_PWD_H
@@ -217,7 +218,8 @@ void ap_reclaim_child_processes(int terminate)
/* now see who is done */
not_dead_yet = 0;
for (i = 0; i < max_daemons; ++i) {
- pid_t pid = ap_mpm_get_child_pid(i);
+ process_score *ps = ap_get_scoreboard_process(i);
+ pid_t pid = ps->pid;
if (pid == 0) {
continue; /* not every scoreboard entry is in use */
@@ -261,7 +263,8 @@ void ap_relieve_child_processes(void)
/* now see who is done */
for (i = 0; i < max_daemons; ++i) {
- pid_t pid = ap_mpm_get_child_pid(i);
+ process_score *ps = ap_get_scoreboard_process(i);
+ pid_t pid = ps->pid;
if (pid == 0) {
continue; /* not every scoreboard entry is in use */