Compare against MAP_FAILED for Qt plat_mmap
This commit is contained in:
@@ -316,8 +316,7 @@ plat_mmap(size_t size, uint8_t executable)
|
|||||||
#else
|
#else
|
||||||
void *ret = mmap(0, size, PROT_READ | PROT_WRITE | (executable ? PROT_EXEC : 0), MAP_ANON | MAP_PRIVATE, 0, 0);
|
void *ret = mmap(0, size, PROT_READ | PROT_WRITE | (executable ? PROT_EXEC : 0), MAP_ANON | MAP_PRIVATE, 0, 0);
|
||||||
#endif
|
#endif
|
||||||
auto retval = *reinterpret_cast<int*>(ret);
|
return (ret == MAP_FAILED) ? nullptr : ret;
|
||||||
return (retval < 0) ? nullptr : ret;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user