From: Ruediger Pluem Date: Fri, 1 Jun 2007 23:04:43 +0000 (+0000) Subject: * Use local pid table also for OS/2 MPM X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a311837d968ca9e26089e58ec00253cfd05b243b;p=thirdparty%2Fapache%2Fhttpd.git * Use local pid table also for OS/2 MPM git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/httpd-pid-table@543654 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/mpmt_os2/mpm.h b/server/mpm/mpmt_os2/mpm.h index f8bbc30eb38..e324d79a387 100644 --- a/server/mpm/mpmt_os2/mpm.h +++ b/server/mpm/mpmt_os2/mpm.h @@ -30,6 +30,7 @@ #include "httpd.h" #include "mpm_default.h" #include "scoreboard.h" +#include "mpm_common.h" #define MPM_NAME "MPMT_OS2" diff --git a/server/mpm/mpmt_os2/mpmt_os2.c b/server/mpm/mpmt_os2/mpmt_os2.c index a5636cefda0..94c54975479 100644 --- a/server/mpm/mpmt_os2/mpmt_os2.c +++ b/server/mpm/mpmt_os2/mpmt_os2.c @@ -281,6 +281,7 @@ static char master_main() #endif if (one_process) { ap_scoreboard_image->parent[0].pid = getpid(); + ap_set_pid_table(getpid()); ap_mpm_child_main(pconf); return FALSE; } @@ -313,6 +314,7 @@ static char master_main() if (slot < HARD_SERVER_LIMIT) { ap_scoreboard_image->parent[slot].pid = 0; ap_scoreboard_image->parent[slot].quiescing = 0; + ap_unset_pid_table(child_pid); if (proc_rc.codeTerminate == TC_EXIT) { /* Child terminated normally, check its exit code and @@ -330,7 +332,12 @@ static char master_main() /* Signal children to shut down, either gracefully or immediately */ for (slot=0; slotparent[slot].pid, is_graceful ? SIGHUP : SIGTERM); + PID pid; + + pid = ap_scoreboard_image->parent[n].pid; + if (ap_in_pid_table(pid)) { + kill(pid, is_graceful ? SIGHUP : SIGTERM); + } } DosFreeMem(parent_info); @@ -364,6 +371,7 @@ static void spawn_child(int slot) } ap_scoreboard_image->parent[slot].pid = proc_rc.codeTerminate; + ap_set_pid_table(proc_rc.codeTerminate); }