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 Wed, 15 May 2002 23:10:52 GMT
jwoolley    02/05/15 16:10:52

  Modified:    buckets  apr_buckets_file.c
  Log:
  file_bucket_read() is not the only caller of file_make_mmap().
  file_bucket_setaside() does it as well, and that call was missed when
  the can_mmap flag was added.  This patch moves the can_mmap test to
  a central location to avoid that problem.
  
  Revision  Changes    Path
  1.72      +5 -2      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.71
  retrieving revision 1.72
  diff -u -d -u -r1.71 -r1.72
  --- apr_buckets_file.c	12 May 2002 04:34:46 -0000	1.71
  +++ apr_buckets_file.c	15 May 2002 23:10:52 -0000	1.72
  @@ -85,6 +85,10 @@
       apr_bucket_file *a = e->data;
       apr_mmap_t *mm;
   
  +    if (!a->can_mmap) {
  +        return 0;
  +    }
  +
       if (filelength > APR_MMAP_LIMIT) {
           if (apr_mmap_create(&mm, a->fd, fileoffset, APR_MMAP_LIMIT,
                               APR_MMAP_READ, p) != APR_SUCCESS) {
  @@ -122,8 +126,7 @@
   #endif
   
   #if APR_HAS_MMAP
  -    if (a->can_mmap &&
  -        file_make_mmap(e, filelength, fileoffset, a->readpool)) {
  +    if (file_make_mmap(e, filelength, fileoffset, a->readpool)) {
           return apr_bucket_read(e, str, len, block);
       }
   #endif
  
  
  

Mime
View raw message