From d3bb567248c33e7145f2dcb24bfd27d1d55c6c83 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 28 Jul 2000 18:15:21 +0000 Subject: [PATCH] Use ap_note_subprocess() to register the mod_cgid daemon process for cleanup 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 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index ffbf332f62..0d437bf863 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -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++; -- 2.40.0