summaryrefslogtreecommitdiff
path: root/modules/generators
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2020-07-14 16:25:43 +0000
committerJoe Orton <jorton@apache.org>2020-07-14 16:25:43 +0000
commitedb644302a32a6191b37ea55812bc3e6a9d2b8cc (patch)
tree3a580fffe84a5c81a497b59571e860d9bc1ca848 /modules/generators
parenta4ee6e97a2f2da9d8357bf2cc34230977bed5ea2 (diff)
downloadhttpd-edb644302a32a6191b37ea55812bc3e6a9d2b8cc.tar.gz
* modules/generators/mod_cgid.c (get_cgi_pid): Fix test for pid=0.
(cgid_handler): Remove duplicated test for pid=0 here added in r1879119. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879860 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/generators')
-rw-r--r--modules/generators/mod_cgid.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c
index 699d7059f9..3803811055 100644
--- a/modules/generators/mod_cgid.c
+++ b/modules/generators/mod_cgid.c
@@ -1517,7 +1517,9 @@ static apr_status_t get_cgi_pid(request_rec *r, cgid_server_conf *conf, pid_t *
return stat;
}
- if (pid == 0) {
+ /* Don't accept zero as a pid here, calling kill(0, SIGTERM) etc
+ * later is unpleasant. */
+ if (*pid == 0) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01261)
"daemon couldn't find CGI process for connection %lu",
r->connection->id);
@@ -1650,9 +1652,7 @@ static int cgid_handler(request_rec *r)
info->r = r;
rv = get_cgi_pid(r, conf, &(info->pid));
- /* Don't accept zero as a pid here, calling kill(0, SIGTERM) etc
- * later is unpleasant. */
- if (rv == APR_SUCCESS && info->pid) {
+ if (rv == APR_SUCCESS) {
apr_pool_cleanup_register(r->pool, info,
cleanup_script, apr_pool_cleanup_null);
}