mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-06 01:40:22 -05:00
shm: handle ftruncate failure
This commit is contained in:
parent
dc42cc1d19
commit
e9f1638750
1 changed files with 5 additions and 1 deletions
6
shm.c
6
shm.c
|
|
@ -264,8 +264,12 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie,
|
||||||
if (scrollable && !can_punch_hole) {
|
if (scrollable && !can_punch_hole) {
|
||||||
initial_offset = 0;
|
initial_offset = 0;
|
||||||
memfd_size = size;
|
memfd_size = size;
|
||||||
ftruncate(pool_fd, memfd_size);
|
|
||||||
scrollable = false;
|
scrollable = false;
|
||||||
|
|
||||||
|
if (ftruncate(pool_fd, memfd_size) < 0) {
|
||||||
|
LOG_ERRNO("failed to set size of SHM backing memory file");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
real_mmapped = mmap(
|
real_mmapped = mmap(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue