[PATCH] Use asserts for mmap failure modes

Chris Robinson chris.kcat at gmail.com
Sun Dec 21 10:00:00 CST 2014


On 12/20/2014 10:43 PM, Michael Gilbert wrote:
> Using exit in shared libraries is a discouraged practice, and wine's
> mmap implementation currently does that.
>
> I attach a proposed change using asserts instead.  Let me know if you
> have any feedback.

assert() can get compiled away to nothing in release builds, so release 
builds will fail to die in those error conditions. I also personally 
think it's better to use abort() instead of assert(0), since assert is 
intended to assert that a given run-time condition is true, else the 
process needs to abort. If the given condition is always false, there's 
no real reason to assert it; just abort instead.



More information about the wine-devel mailing list