]> granicus.if.org Git - apache/commitdiff
watch out for the should-not-occur condition where the daemon can't
authorJeff Trawick <trawick@apache.org>
Tue, 12 Nov 2002 12:23:42 +0000 (12:23 +0000)
committerJeff Trawick <trawick@apache.org>
Tue, 12 Nov 2002 12:23:42 +0000 (12:23 +0000)
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

index 4e188b6c3cdbe7b723648ce982d8ccc993278506..69f8420772b5b4c2e697b289fbe472cacee38f81 100644 (file)
@@ -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)