diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-08-11 15:22:12 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-08-11 15:22:12 +0000 |
| commit | 732e181b1d360425cf1b4853158e266ad4f07384 (patch) | |
| tree | 3ea0be922e854b8c0acc1de979d88b5708dbeca2 | |
| parent | Merge branch 'xmalloc-conversion' into master (diff) | |
shm: don't even try to punch a memfd hole in 32-bit
This ensures we don't issue a warning if we fail, something that will
just confuse users, as SHM scrolling is disabled in 32-bit anyway.
| -rw-r--r-- | shm.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -291,6 +291,7 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie, if (!can_punch_hole_initialized) { can_punch_hole_initialized = true; +#if defined(__x86_64__) can_punch_hole = fallocate( pool_fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 1) == 0; @@ -299,6 +300,11 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie, "fallocate(FALLOC_FL_PUNCH_HOLE) not " "supported (%s): expect lower performance", strerror(errno)); } +#else + /* This is mostly to make sure we skip the warning issued + * above */ + can_punch_hole = false; +#endif } if (scrollable && !can_punch_hole) { |
