apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwool...@apache.org
Subject cvs commit: apr/mmap/win32 mmap.c
Date Wed, 10 Apr 2002 04:54:21 GMT
jwoolley    02/04/09 21:54:21

  Modified:    mmap/unix mmap.c
               mmap/win32 mmap.c
  Log:
  Sanitize some return types.
  
  Revision  Changes    Path
  1.42      +6 -4      apr/mmap/unix/mmap.c
  
  Index: mmap.c
  ===================================================================
  RCS file: /home/cvs/apr/mmap/unix/mmap.c,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -d -u -r1.41 -r1.42
  --- mmap.c	10 Apr 2002 04:31:10 -0000	1.41
  +++ mmap.c	10 Apr 2002 04:54:21 -0000	1.42
  @@ -85,8 +85,10 @@
       apr_mmap_t *mm = themmap;
       int rv;
   
  -    if ((!mm->is_owner) || (mm->mm == (void *)-1)) {
  -        /* XXX: we shouldn't ever get here */
  +    if (!mm->is_owner) {
  +        return APR_EINVAL;
  +    }
  +    else if (mm->mm == (void *)-1) {
           return APR_ENOENT;
       }
   
  @@ -197,9 +199,9 @@
   
   APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm)
   {
  -    apr_status_t rv = APR_SUCCESS;
  +    apr_status_t rv;
   
  -    if (mm->is_owner && ((rv = mmap_cleanup(mm)) == APR_SUCCESS)) {
  +    if ((rv = mmap_cleanup(mm)) == APR_SUCCESS) {
           apr_pool_cleanup_kill(mm->cntxt, mm, mmap_cleanup);
           return APR_SUCCESS;
       }
  
  
  
  1.13      +6 -4      apr/mmap/win32/mmap.c
  
  Index: mmap.c
  ===================================================================
  RCS file: /home/cvs/apr/mmap/win32/mmap.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -d -u -r1.12 -r1.13
  --- mmap.c	10 Apr 2002 04:31:10 -0000	1.12
  +++ mmap.c	10 Apr 2002 04:54:21 -0000	1.13
  @@ -68,8 +68,10 @@
       apr_mmap_t *mm = themmap;
       apr_status_t rv = 0;
   
  -    if (!mm->is_owner || !mm->mhandle) {
  -        /* XXX: we shouldn't ever get here */
  +    if (!mm->is_owner) {
  +        return APR_EINVAL;
  +    }
  +    else if (!mm->mhandle) {
           return APR_ENOENT;
       }
   
  @@ -197,9 +199,9 @@
   
   APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm)
   {
  -    apr_status_t rv = APR_SUCCESS;
  +    apr_status_t rv;
   
  -    if (mm->is_owner && ((rv = mmap_cleanup(mm)) == APR_SUCCESS)) {
  +    if ((rv = mmap_cleanup(mm)) == APR_SUCCESS) {
           apr_pool_cleanup_kill(mm->cntxt, mm, mmap_cleanup);
           return APR_SUCCESS;
       }
  
  
  

Mime
View raw message