httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@kiwi.ics.uci.edu>
Subject Re: cvs commit: apache-1.3/src/main alloc.c util.c
Date Fri, 25 Sep 1998 23:20:33 GMT
Hah! You beat my commit of the same change by 10 seconds.

....Roy
In message <19980925230155.23471.qmail@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;
>       }
>   
>  
>  
>  


Mime
View raw message