apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jus...@erenkrantz.com>
Subject RE: mmap bug?
Date Thu, 27 Feb 2003 17:18:01 GMT
--On Thursday, February 27, 2003 4:14 PM +0100 Sander Striker 
<striker@apache.org> wrote:

> @@ -99,7 +99,10 @@
>  #ifdef BEOS
>      rv = delete_area(mm->area);
>  #else
> -    rv = munmap(mm->mm, mm->size);
> +    if (mm->mm != NULL)
> +      rv = munmap(mm->mm, mm->size);
> +    else
> +      rv = APR_SUCCESS;
>  #endif
>      mm->mm = (void *)-1;
>
>
> Someone with some more mmap-fu, please review.

How about:

if (mm->mm == NULL && !mm->size)
  rv = APR_SUCCESS;
else
  rv = munmap(mm->mm, mm->size);

(My brain isn't awake enough to get the reverse conditional right.)

If a platform gives us address 0 for a non-zero size, well, that's not our 
fault if it complains on munmap.  =)  -- justin

Mime
View raw message