You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by st...@hyperreal.org on 2000/02/13 01:39:05 UTC

cvs commit: apache-2.0/src/modules/standard mod_cgi.c

stoddard    00/02/12 16:39:05

  Modified:    src/modules/standard mod_cgi.c
  Log:
  Set up return codes correctly in the failure case.
  
  Revision  Changes    Path
  1.28      +10 -10    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.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- mod_cgi.c	2000/01/19 02:41:58	1.27
  +++ mod_cgi.c	2000/02/13 00:39:04	1.28
  @@ -329,24 +329,24 @@
       /* 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 {