httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/standard mod_file_cache.c
Date Tue, 03 Oct 2000 21:48:34 GMT
trawick     00/10/03 14:48:33

  Modified:    src/modules/standard mod_file_cache.c
  Log:
  Fix some bad calls to ap_log_error(); some of these neglected to
  turn on APLOG_NOERRNO even though no syscall failure was being
  reported; others passed errno instead of the APR retcode.
  
  Revision  Changes    Path
  1.27      +20 -20    apache-2.0/src/modules/standard/mod_file_cache.c
  
  Index: mod_file_cache.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_file_cache.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- mod_file_cache.c	2000/10/03 15:05:26	1.26
  +++ mod_file_cache.c	2000/10/03 21:48:31	1.27
  @@ -224,14 +224,14 @@
   
       /* canonicalize the file name? */
       /* os_canonical... */
  -    if (apr_stat(&tmp.finfo, filename, cmd->temp_pool) != APR_SUCCESS) { 
  -	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, cmd->server,
  -	    "file_cache: unable to stat(%s), skipping", filename);
  +    if ((rc = apr_stat(&tmp.finfo, filename, cmd->temp_pool)) != APR_SUCCESS) {
  +	ap_log_error(APLOG_MARK, APLOG_WARNING, rc, cmd->server,
  +	    "mod_file_cache: unable to stat(%s), skipping", filename);
   	return NULL;
       }
       if (tmp.finfo.filetype != APR_REG) {
  -	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, cmd->server,
  -	    "file_cache: %s isn't a regular file, skipping", filename);
  +	ap_log_error(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, 0, cmd->server,
  +	    "mod_file_cache: %s isn't a regular file, skipping", filename);
   	return NULL;
       }
   
  @@ -242,7 +242,7 @@
       rc = open_file(&fd, filename, APR_READ, APR_OS_DEFAULT, cmd->pool);
       if (rc != APR_SUCCESS) {
           ap_log_error(APLOG_MARK, APLOG_WARNING, rc, cmd->server,
  -                     "file_cache: unable to open(%s, O_RDONLY), skipping", filename);
  +                     "mod_file_cache: unable to open(%s, O_RDONLY), skipping", filename);
   	return NULL;
       }
       tmp.file = fd;
  @@ -260,7 +260,7 @@
       return NULL;
   #else
       /* Sendfile not supported on this platform */
  -    ap_log_error(APLOG_MARK, APLOG_WARNING, errno, cmd->server,
  +    ap_log_error(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, 0, cmd->server,
                    "mod_file_cache: unable to cache file: %s. Sendfile is not supported on
this OS", filename);
       return NULL;
   #endif
  @@ -273,30 +273,30 @@
       a_file *new_file;
       a_file tmp;
       apr_file_t *fd = NULL;
  +    apr_status_t rc;
       const char *fspec;
   
       fspec = ap_os_case_canonical_filename(cmd->pool, filename);
  -    if (apr_stat(&tmp.finfo, fspec, cmd->temp_pool) != APR_SUCCESS) { 
  -	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, cmd->server,
  +    if ((rc = apr_stat(&tmp.finfo, fspec, cmd->temp_pool)) != APR_SUCCESS) {
  +	ap_log_error(APLOG_MARK, APLOG_WARNING, rc, cmd->server,
   	    "mod_file_cache: unable to stat(%s), skipping", filename);
   	return NULL;
       }
       if ((tmp.finfo.filetype) != APR_REG) {
  -	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, cmd->server,
  +	ap_log_error(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, 0, cmd->server,
   	    "mod_file_cache: %s isn't a regular file, skipping", filename);
   	return NULL;
       }
  -    if (apr_open(&fd, fspec, APR_READ, APR_OS_DEFAULT, cmd->temp_pool) 
  -                != APR_SUCCESS) { 
  -	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, cmd->server,
  -	    "mod_file_cache: unable to open(%s, O_RDONLY), skipping", filename);
  +    if ((rc = apr_open(&fd, fspec, APR_READ, APR_OS_DEFAULT, 
  +                       cmd->temp_pool)) != APR_SUCCESS) { 
  +	ap_log_error(APLOG_MARK, APLOG_WARNING, rc, cmd->server,
  +                     "mod_file_cache: unable to open %s, skipping", 
  +                     filename);
   	return NULL;
       }
  -    if (apr_mmap_create(&tmp.mm, fd, 0, tmp.finfo.size, cmd->pool) != APR_SUCCESS)
{ 
  -	int save_errno = errno;
  +    if ((rc = apr_mmap_create(&tmp.mm, fd, 0, tmp.finfo.size, cmd->pool)) != APR_SUCCESS)
{ 
   	apr_close(fd);
  -	errno = save_errno;
  -	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, cmd->server,
  +	ap_log_error(APLOG_MARK, APLOG_WARNING, rc, cmd->server,
   	    "mod_file_cache: unable to mmap %s, skipping", filename);
   	return NULL;
       }
  @@ -477,9 +477,9 @@
   static command_rec file_cache_cmds[] =
   {
   AP_INIT_ITERATE("cachefile", cachefile, NULL, RSRC_CONF,
  -     "A space seperated list of files to add to the file handle cache at config time"),
  +     "A space separated list of files to add to the file handle cache at config time"),
   AP_INIT_ITERATE("mmapfile", mmapfile, NULL, RSRC_CONF,
  -     "A space seperated list of files to mmap at config time"),
  +     "A space separated list of files to mmap at config time"),
       {NULL}
   };
   
  
  
  

Mime
View raw message