From dfbc3300ee55475ed720a6ed0482a677479ad907 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 12 Nov 2002 12:23:42 +0000 Subject: [PATCH] watch out for the should-not-occur condition where the daemon can't find the script pid in the hash and returns zero... if we send sigterm to pid zero, we knock out ourself change the cleanup to return any error from cleanup_nonchild_process() git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97493 13f79535-47bb-0310-9956-ffa450edef68 --- modules/generators/mod_cgid.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index 4e188b6c3cd..69f8420772b 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -1126,9 +1126,13 @@ static apr_status_t cleanup_script(void *vptr) } close(sd); - cleanup_nonchild_process(info->r, pid); - - return APR_SUCCESS; + if (pid == 0) { + ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, info->r, + "daemon couldn't find CGI process for connection %lu", + info->conn_id); + return APR_EGENERAL; + } + return cleanup_nonchild_process(info->r, pid); } static int cgid_handler(request_rec *r) -- 2.47.3