]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* Use local pid table also for OS/2 MPM
authorRuediger Pluem <rpluem@apache.org>
Fri, 1 Jun 2007 23:04:43 +0000 (23:04 +0000)
committerRuediger Pluem <rpluem@apache.org>
Fri, 1 Jun 2007 23:04:43 +0000 (23:04 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/httpd-pid-table@543654 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/mpmt_os2/mpm.h
server/mpm/mpmt_os2/mpmt_os2.c

index f8bbc30eb38c96245a816ec5bd489357c0b5ac17..e324d79a387fb84479a8d85e9425552f7afdee49 100644 (file)
@@ -30,6 +30,7 @@
 #include "httpd.h"
 #include "mpm_default.h"
 #include "scoreboard.h"
+#include "mpm_common.h"
 
 #define MPM_NAME "MPMT_OS2"
 
index a5636cefda0b8c7dc957a5bbc08f859e35997783..94c54975479d0e97e5b11cc39896b0effc9af1e5 100644 (file)
@@ -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; slot<HARD_SERVER_LIMIT; slot++) {
-      kill(ap_scoreboard_image->parent[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);
 }