Skip to content

Commit

Permalink
wayland/display: Fix mmap use
Browse files Browse the repository at this point in the history
> From version 7 onwards, the fd must be mapped with MAP_PRIVATE by the recipient, as MAP_SHARED may fail.

 - https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_keyboard

Signed-off-by: Samuel Dionne-Riel <[email protected]>
  • Loading branch information
samueldr authored and lbonn committed May 5, 2024
1 parent 51dec9d commit b04bedc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/wayland/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ static void wayland_keyboard_keymap(void *data, struct wl_keyboard *keyboard,
return;
}

char *str = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
char *str = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
if (str == MAP_FAILED) {
close(fd);
return;
Expand Down

0 comments on commit b04bedc

Please sign in to comment.