stoddard 99/10/12 07:45:59
Modified: src/modules/standard mod_cgi.c
Log:
Fix bug interpreting cgi_child return code. Do some clean-up.
Revision Changes Path
1.8 +6 -16 apache-2.0/src/modules/standard/mod_cgi.c
Index: mod_cgi.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_cgi.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- mod_cgi.c 1999/10/12 04:06:58 1.7
+++ mod_cgi.c 1999/10/12 14:45:57 1.8
@@ -295,7 +295,7 @@
char *argv0;
};
-static int cgi_child(struct cgi_child_stuff *child_stuff,
+static ap_status_t cgi_child(struct cgi_child_stuff *child_stuff,
BUFF **script_out, BUFF **script_in, BUFF **script_err)
{
struct cgi_child_stuff *cld = child_stuff;
@@ -308,7 +308,7 @@
ap_procattr_t *procattr;
ap_proc_t *procnew;
ap_os_proc_t fred;
- int rc;
+ ap_status_t rc = APR_SUCCESS;
#ifdef DEBUG_CGI
#ifdef OS2
@@ -346,11 +346,6 @@
* NB only ISINDEX scripts get decoded arguments.
*/
-#ifdef TPF
- ap_unblock_alarms();
-
- return (0);
-#else
ap_cleanup_for_exec();
if ((ap_createprocattr_init(&procattr, child_context) != APR_SUCCESS) ||
@@ -363,9 +358,7 @@
/* Something bad happened, tell the world. */
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
"couldn't create child process: %s", r->filename);
- ap_unblock_alarms();
-
- return (-1);
+ rc = !APR_SUCCESS;
}
else {
@@ -409,12 +402,9 @@
*script_err = ap_bcreate(child_context, B_RD);
}
}
-
- ap_unblock_alarms();
-
- return (rc);
}
-#endif /* TPF */
+ ap_unblock_alarms();
+ return (rc);
}
static int cgi_handler(request_rec *r)
@@ -500,7 +490,7 @@
* waiting for free_proc_chain to cleanup in the middle of an
* SSI request -djg
*/
- if (cgi_child(&cld, &script_out, &script_in, &script_err) < 0) {
+ if (cgi_child(&cld, &script_out, &script_in, &script_err) !=
APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
"couldn't spawn child process: %s", r->filename);
return HTTP_INTERNAL_SERVER_ERROR;