diff options
author | emersion <contact@emersion.fr> | 2018-11-09 19:34:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-09 19:34:42 +0100 |
commit | e70a55220344df6c4d786466a29a187229cf8145 (patch) | |
tree | d3a54f176f9908216e2dfbc9dfd423673a770c8d | |
parent | 0b5485cf8372a0e5c7aced47c9f37f0506be297e (diff) | |
parent | 753540335b8ff2e339402dce6500416333899416 (diff) |
Merge pull request #1361 from sghctoma/fix-shm
Force ftruncate for shared memory objects on FreeBSD
-rw-r--r-- | include/wlr/config.h.in | 2 | ||||
-rw-r--r-- | meson.build | 4 | ||||
-rw-r--r-- | util/shm.c | 12 |
3 files changed, 0 insertions, 18 deletions
diff --git a/include/wlr/config.h.in b/include/wlr/config.h.in index 750ad3b7..17277c07 100644 --- a/include/wlr/config.h.in +++ b/include/wlr/config.h.in @@ -14,6 +14,4 @@ #mesondefine WLR_HAS_XCB_ICCCM #mesondefine WLR_HAS_XCB_XKB -#mesondefine WLR_HAS_POSIX_FALLOCATE - #endif diff --git a/meson.build b/meson.build index 18a5d908..1ed93c04 100644 --- a/meson.build +++ b/meson.build @@ -72,10 +72,6 @@ if logind.found() wlr_deps += logind endif -if cc.has_header_symbol('fcntl.h', 'posix_fallocate', prefix: '#define _POSIX_C_SOURCE 200112L') - conf_data.set('WLR_HAS_POSIX_FALLOCATE', true) -endif - subdir('protocol') subdir('render') @@ -42,17 +42,6 @@ int allocate_shm_file(size_t size) { return -1; } -#ifdef WLR_HAS_POSIX_FALLOCATE - int ret; - do { - ret = posix_fallocate(fd, 0, size); - } while (ret == EINTR); - if (ret != 0) { - close(fd); - errno = ret; - return -1; - } -#else int ret; do { ret = ftruncate(fd, size); @@ -61,7 +50,6 @@ int allocate_shm_file(size_t size) { close(fd); return -1; } -#endif return fd; } |