aboutsummaryrefslogtreecommitdiff
path: root/shm.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-03-06 18:21:57 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-03-06 18:21:57 +0000
commite4436e84dfa68119496032621e284588c621fa99 (patch)
treeeaf7569ef09ec6fb369aa599ea4d13acadd87833 /shm.c
parentsixel: CSI setters also write a reply to the client (diff)
parentwayland: remove debug logs (diff)
Merge branch 'csd'
This implements client side decorations and have been tested on GNOME and Weston. They also render correctly in KWin, but cannot be used to move or resize the window. I believe this is a bug in KWin's handling of sub-surfaces positioned outside the parent surface. Luckily, KWin uses server side decorations. This merge also contains a lot of bug fixes related to resizing and rendering of sub-surfaces in general (i.e. the scrollback search box).
Diffstat (limited to 'shm.c')
-rw-r--r--shm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/shm.c b/shm.c
index 33095e74..56395fab 100644
--- a/shm.c
+++ b/shm.c
@@ -2,6 +2,7 @@
#include <unistd.h>
#include <assert.h>
+#include <errno.h>
#include <sys/types.h>
#include <sys/mman.h>
@@ -124,13 +125,15 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie)
size = stride * height;
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) {
static bool failure_logged = false;
if (!failure_logged) {
failure_logged = true;
- LOG_ERRNO_P("failed to fallocate", err);
+ LOG_ERRNO_P("failed to fallocate %zu bytes", err, size);
}
if (ftruncate(pool_fd, size) == -1) {