You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@kiwi.ics.uci.edu> on 1998/09/26 01:20:33 UTC

Re: cvs commit: apache-1.3/src/main alloc.c util.c

Hah! You beat my commit of the same change by 10 seconds.

....Roy
In message <19...@hyperreal.org>, jim@hyperreal.org writes
:
>jim         98/09/25 16:01:55
>
>  Modified:    src/main alloc.c util.c
>  Log:
>  Maintain state of errno in ap_pcfg_openfile
>  and the functions that it calls. Needed when parsing .htaccess
>  
>  Revision  Changes    Path
>  1.100     +6 -1      apache-1.3/src/main/alloc.c
>  
>  Index: alloc.c
>  ===================================================================
>  RCS file: /export/home/cvs/apache-1.3/src/main/alloc.c,v
>  retrieving revision 1.99
>  retrieving revision 1.100
>  diff -u -r1.99 -r1.100
>  --- alloc.c	1998/08/14 02:49:47	1.99
>  +++ alloc.c	1998/09/25 23:01:49	1.100
>  @@ -1744,6 +1744,7 @@
>       FILE *fd = NULL;
>       int baseFlag, desc;
>       int modeFlags = 0;
>  +    int saved_errno;
>   
>   #ifdef WIN32
>       modeFlags = _S_IREAD | _S_IWRITE;
>  @@ -1766,22 +1767,26 @@
>       else {
>   	fd = fopen(name, mode);
>       }
>  -
>  +    saved_errno = errno;
>       if (fd != NULL)
>   	ap_note_cleanups_for_file(a, fd);
>       ap_unblock_alarms();
>  +    errno = saved_errno;
>       return fd;
>   }
>   
>   API_EXPORT(FILE *) ap_pfdopen(pool *a, int fd, const char *mode)
>   {
>       FILE *f;
>  +    int saved_errno;
>   
>       ap_block_alarms();
>       f = ap_fdopen(fd, mode);
>  +    saved_errno = errno;
>       if (f != NULL)
>   	ap_note_cleanups_for_file(a, f);
>       ap_unblock_alarms();
>  +    errno = saved_errno;
>       return f;
>   }
>   
>  
>  
>  
>  1.134     +5 -0      apache-1.3/src/main/util.c
>  
>  Index: util.c
>  ===================================================================
>  RCS file: /export/home/cvs/apache-1.3/src/main/util.c,v
>  retrieving revision 1.133
>  retrieving revision 1.134
>  diff -u -r1.133 -r1.134
>  --- util.c	1998/09/17 15:56:08	1.133
>  +++ util.c	1998/09/25 23:01:49	1.134
>  @@ -738,6 +738,7 @@
>       poolfile_t *new_pfile;
>       FILE *file;
>       struct stat stbuf;
>  +    int saved_errno;
>   
>       if (name == NULL) {
>           ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, NULL,
>  @@ -747,9 +748,11 @@
>   
>       file = ap_pfopen(p, name, "r");
>   #ifdef DEBUG
>  +    saved_errno = errno;
>       ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, NULL,
>                   "Opening config file %s (%s)",
>                   name, (file == NULL) ? strerror(errno) : "successful");
>  +    errno = saved_errno;
>   #endif
>       if (file == NULL)
>           return NULL;
>  @@ -761,10 +764,12 @@
>   #else
>           strcmp(name, "/dev/null") != 0) {
>   #endif
>  +	saved_errno = errno;
>           ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, NULL,
>                       "Access to file %s denied by server: not a regular file
>",
>                       name);
>           ap_pfclose(p, file);
>  +	errno = saved_errno;
>           return NULL;
>       }
>   
>  
>  
>