mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-03 09:01:42 -05:00
Use MAP_FAILED instead of (void *) -1
While MAP_FAILED is generally defined to that value, we should not be relying on implementation details of system headers. Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk> Reviewed-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
parent
3bda3d1b47
commit
1349d3d15b
1 changed files with 2 additions and 4 deletions
|
|
@ -511,10 +511,8 @@ sigbus_handler(int signum, siginfo_t *info, void *context)
|
||||||
sigbus_data->fallback_mapping_used = 1;
|
sigbus_data->fallback_mapping_used = 1;
|
||||||
|
|
||||||
/* This should replace the previous mapping */
|
/* This should replace the previous mapping */
|
||||||
if (mmap(pool->data, pool->size,
|
if (mmap(pool->data, pool->size, PROT_READ | PROT_WRITE,
|
||||||
PROT_READ | PROT_WRITE,
|
MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS, 0, 0) == MAP_FAILED) {
|
||||||
MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS,
|
|
||||||
0, 0) == (void *) -1) {
|
|
||||||
reraise_sigbus();
|
reraise_sigbus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue