]> granicus.if.org Git - apache/commitdiff
Set up return codes correctly in the failure case.
authorBill Stoddard <stoddard@apache.org>
Sun, 13 Feb 2000 00:39:04 +0000 (00:39 +0000)
committerBill Stoddard <stoddard@apache.org>
Sun, 13 Feb 2000 00:39:04 +0000 (00:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84617 13f79535-47bb-0310-9956-ffa450edef68

modules/generators/mod_cgi.c

index 67d419702574545d30bc8af9ad302f5f27525527..e96545cf779e56677d3d698356045fa0537d1c21 100644 (file)
@@ -329,24 +329,24 @@ static ap_status_t run_cgi_child(BUFF **script_out, BUFF **script_in, BUFF **scr
     /* Transumute ourselves into the script.
      * NB only ISINDEX scripts get decoded arguments.
      */
-    if ((ap_createprocattr_init(&procattr, p) != APR_SUCCESS) ||
-        (ap_setprocattr_io(procattr, 
-                           APR_FULL_BLOCK, 
-                           APR_FULL_BLOCK,
-                           APR_FULL_BLOCK) != APR_SUCCESS) ||
-        (ap_setprocattr_dir(procattr, ap_make_dirstr_parent(r->pool, r->filename))        != APR_SUCCESS) ||
-        (ap_setprocattr_cmdtype(procattr, APR_PROGRAM)    != APR_SUCCESS)) {
+    if (((rc = ap_createprocattr_init(&procattr, p)) != APR_SUCCESS) ||
+        ((rc = ap_setprocattr_io(procattr, 
+                                 APR_FULL_BLOCK, 
+                                 APR_FULL_BLOCK,
+                                 APR_FULL_BLOCK)) != APR_SUCCESS) ||
+        ((rc = ap_setprocattr_dir(procattr, 
+                                  ap_make_dirstr_parent(r->pool, r->filename))) != APR_SUCCESS) ||
+        ((rc = ap_setprocattr_cmdtype(procattr, APR_PROGRAM)) != APR_SUCCESS)) {
         /* Something bad happened, tell the world. */
-       ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
+       ap_log_rerror(APLOG_MARK, APLOG_ERR, rc, r,
                      "couldn't create child process: %s", r->filename);
-        rc = !APR_SUCCESS;
     }
     else {
         rc = ap_create_process(&procnew, command, argv, env, procattr, p);
     
         if (rc != APR_SUCCESS) {
             /* Bad things happened. Everyone should have cleaned up. */
-            ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
+            ap_log_rerror(APLOG_MARK, APLOG_ERR, rc, r,
                         "couldn't create child process: %d: %s", rc, r->filename);
         }
         else {