You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ro...@imdb.com> on 1996/06/15 03:28:28 UTC
Re: apache 1.1.1b3 better CGI and include error messages
Thanks. The patch will be considered. Looks ok to me.
>From: David MacKenzie <dj...@va.pubnix.com>
>Subject: friendlier error messages when external programs fail
>Affects: src/mod_cgi.c src/mod_include.c
>ChangeLog: Use strerror() where appropriate.
>Comments: Let's get out of the dark ages of errno!
>
>*** 1.1 1996/06/14 22:13:06
>--- ./mod_cgi.c 1996/06/14 22:15:11
>***************
>*** 199,205 ****
> */
>
> sprintf(err_string,
>! "exec of %s failed, errno is %d\n", r->filename, errno);
> write(2, err_string, strlen(err_string));
> exit(0);
> }
>--- 211,217 ----
> */
>
> sprintf(err_string,
>! "exec of %s failed: %s\n", r->filename, strerror(errno));
> write(2, err_string, strlen(err_string));
> exit(0);
> }
>
>*** 1.1 1996/06/14 22:29:26
>--- ./mod_include.c 1996/06/14 22:30:35
>***************
>*** 489,496 ****
> #ifdef DEBUG_INCLUDE_CMD
> fprintf (dbg, "Exec failed\n");
> #endif
>! sprintf(err_string, "httpd: exec of %s failed, errno is %d\n",
>! SHELL_PATH,errno);
> write (2, err_string, strlen(err_string));
> exit(0);
> }
>--- 494,501 ----
> #ifdef DEBUG_INCLUDE_CMD
> fprintf (dbg, "Exec failed\n");
> #endif
>! sprintf(err_string, "httpd: exec of %s failed: %s\n",
>! SHELL_PATH,strerror(errno));
> write (2, err_string, strlen(err_string));
> exit(0);
> }
>***************
>*** 524,531 ****
> return 1;
> if(!strcmp(tag,"cmd")) {
> if(include_cmd(tag_val, r) == -1) {
>! log_printf(r->server, "failed command exec %s in %s",
>! tag_val, file);
> rputs(error, r);
> }
> /* just in case some stooge changed directories */
>--- 529,536 ----
> return 1;
> if(!strcmp(tag,"cmd")) {
> if(include_cmd(tag_val, r) == -1) {
>! log_printf(r->server, "failed command exec %s in %s: %s",
>! tag_val, file, strerror(errno));
> rputs(error, r);
> }
> /* just in case some stooge changed directories */