apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sander Striker" <stri...@apache.org>
Subject RE: mmap bug?
Date Thu, 27 Feb 2003 16:41:34 GMT
> From: Cliff Woolley [mailto:jwoolley@virginia.edu]
> Sent: Thursday, February 27, 2003 5:18 PM

> On Thu, 27 Feb 2003, Sander Striker wrote:
> 
> >  #else
> > -    rv = munmap(mm->mm, mm->size);
> > +    if (mm->mm != NULL)
> > +      rv = munmap(mm->mm, mm->size);
> > +    else
> > +      rv = APR_SUCCESS;
> 
> Wouldn't it be better to check mmap()'s return value in apr_mmap_create()
> and have it return an error rather than checking mm->mm in
> apr_mmap_delete()?

It depends wether you consider it an error.  I personally don't.
Since an x byte file can be at any address when mmap'd and you can
always read x bytes at that address, why return an error?

Sander

Mime
View raw message