we should actually check for MAP_FAILED as per the manual page

This commit is contained in:
Nadia Holmquist Pedersen 2023-07-24 17:59:36 +02:00
parent ad4cfb6e64
commit 680bcb9de0
1 changed files with 1 additions and 1 deletions

View File

@ -339,7 +339,7 @@ bool UnmapFromRange(u32 addr, u32 num, u32 offset, u32 size)
#elif defined(_WIN32)
return UnmapViewOfFile(dst);
#elif defined(NEEDS_ANON_MAP)
return mmap(dst, size, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0) == 0;
return mmap(dst, size, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0) != MAP_FAILED;
#else
return munmap(dst, size) == 0;
#endif