]> granicus.if.org Git - apache/commitdiff
Use ap_note_subprocess() to register the mod_cgid daemon process for cleanup
authorJeff Trawick <trawick@apache.org>
Fri, 28 Jul 2000 18:15:21 +0000 (18:15 +0000)
committerJeff Trawick <trawick@apache.org>
Fri, 28 Jul 2000 18:15:21 +0000 (18:15 +0000)
so that it is killed at termination if it does not die when the parent gets
SIGTERM.  This change is to fix occasional problems where the process stays
around.

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

modules/generators/mod_cgid.c

index ffbf332f623f4225e6180aa10c246307568e1d90..0d437bf863ef772de8f23d2b7f32ac97c802fdb2 100644 (file)
@@ -601,7 +601,7 @@ static int cgid_server(void *data)
 static void cgid_init(ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp, server_rec *main_server) 
 { 
     pid_t pid; 
-    ap_proc_t ap_pid;
+    ap_proc_t *procnew;
 
     if (once_through > 0) { 
         ap_create_pool(&pcgi, p); 
@@ -614,10 +614,12 @@ static void cgid_init(ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp, server_re
             cgid_server(main_server);
             exit(-1);
         } 
+        procnew = ap_pcalloc(p, sizeof(*procnew));        
+        procnew->pid = pid;
+        procnew->err = procnew->in = procnew->out = NULL;
+        ap_note_subprocess(p, procnew, kill_after_timeout);
 #if APR_HAS_OTHER_CHILD
-        ap_pid.pid = pid;
-        ap_pid.err = ap_pid.in = ap_pid.out = NULL;
-        ap_register_other_child(&ap_pid, cgid_maint, NULL, NULL, p);
+        ap_register_other_child(procnew, cgid_maint, NULL, NULL, p);
 #endif
     } 
     else once_through++;