apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwool...@apache.org
Subject cvs commit: apr-util/buckets apr_buckets_file.c
Date Sun, 25 Nov 2001 04:20:14 GMT
jwoolley    01/11/24 20:20:14

  Modified:    buckets  apr_buckets_file.c
  Log:
  I'd have sworn I simplified this logic a million years ago.  Must have
  forgotten to commit it.  Anyway, this is not really any functional change,
  but simplier logic that might execute a teensie weensie bit faster and is
  mainly just easier to read.
  
  Revision  Changes    Path
  1.58      +6 -16     apr-util/buckets/apr_buckets_file.c
  
  Index: apr_buckets_file.c
  ===================================================================
  RCS file: /home/cvs/apr-util/buckets/apr_buckets_file.c,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -d -u -r1.57 -r1.58
  --- apr_buckets_file.c	2001/11/12 03:22:25	1.57
  +++ apr_buckets_file.c	2001/11/25 04:20:14	1.58
  @@ -97,24 +97,14 @@
                              apr_off_t fileoffset, apr_pool_t *p)
   {
       apr_bucket_file *a = e->data;
  -    apr_file_t *f = a->fd;
       apr_mmap_t *mm;
   
  -    if ((filelength >= MMAP_THRESHOLD)
  -        && (filelength < MMAP_LIMIT)) {
  -        /* we need to protect ourselves in case we die while we've got the
  -         * file mmapped */
  -        apr_status_t status;
  -        if ((status = apr_mmap_create(&mm, f, fileoffset, filelength, 
  -                                      APR_MMAP_READ, p)) != APR_SUCCESS) {
  -            mm = NULL;
  -        }
  -    }
  -    else {
  -        mm = NULL;
  -    }
  -    if (mm) {
  -        apr_bucket_mmap_make(e, mm, 0, filelength); /*XXX: check for failure? */
  +    if ((filelength >= MMAP_THRESHOLD) &&
  +        (filelength < MMAP_LIMIT) &&
  +        (apr_mmap_create(&mm, a->fd, fileoffset, filelength,
  +                         APR_MMAP_READ, p) == APR_SUCCESS))
  +    {
  +        apr_bucket_mmap_make(e, mm, 0, filelength);
           file_destroy(a);
           return 1;
       }
  
  
  

Mime
View raw message