mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-03 07:15:29 -04:00
shm: handle EINTR in posix_fallocate()
This commit is contained in:
parent
ac32bcda07
commit
3f601a31dc
1 changed files with 4 additions and 1 deletions
5
shm.c
5
shm.c
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
@ -124,7 +125,9 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie)
|
||||||
size = stride * height;
|
size = stride * height;
|
||||||
LOG_DBG("cookie=%lx: allocating new buffer: %zu KB", cookie, size / 1024);
|
LOG_DBG("cookie=%lx: allocating new buffer: %zu KB", cookie, size / 1024);
|
||||||
|
|
||||||
int err = posix_fallocate(pool_fd, 0, size);
|
int err = EINTR;
|
||||||
|
while (err == EINTR)
|
||||||
|
err = posix_fallocate(pool_fd, 0, size);
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
static bool failure_logged = false;
|
static bool failure_logged = false;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue