diff options
| author | Jan Beich <jbeich@FreeBSD.org> | 2020-02-15 15:15:00 +0000 |
|---|---|---|
| committer | Jan Beich <jbeich@FreeBSD.org> | 2020-02-23 20:42:54 +0000 |
| commit | 1283d54dac97216fb7bf099b864a6728043e2d8d (patch) | |
| tree | 12d7aba93064a595dec5311b08ce7e3962bf7316 /cursor | |
| parent | meson/tests: add missing dependencies on protocol headers (diff) | |
| download | wayland-1283d54dac97216fb7bf099b864a6728043e2d8d.tar wayland-1283d54dac97216fb7bf099b864a6728043e2d8d.tar.gz wayland-1283d54dac97216fb7bf099b864a6728043e2d8d.tar.bz2 wayland-1283d54dac97216fb7bf099b864a6728043e2d8d.tar.lz wayland-1283d54dac97216fb7bf099b864a6728043e2d8d.tar.xz wayland-1283d54dac97216fb7bf099b864a6728043e2d8d.tar.zst wayland-1283d54dac97216fb7bf099b864a6728043e2d8d.zip | |
cursor: posix_fallocate may fail with EINVAL if not supported
ZFS on FreeBSD >= 12.0 returns EINVAL, see
https://svnweb.freebsd.org/changeset/base/325320
Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
Diffstat (limited to 'cursor')
| -rw-r--r-- | cursor/os-compatibility.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cursor/os-compatibility.c b/cursor/os-compatibility.c index 6f5b39f..002bb5c 100644 --- a/cursor/os-compatibility.c +++ b/cursor/os-compatibility.c @@ -157,13 +157,13 @@ os_create_anonymous_file(off_t size) #ifdef HAVE_POSIX_FALLOCATE /* - * Filesystems that do support fallocate will return EOPNOTSUPP. - * In this case we need to fall back to ftruncate + * Filesystems that do support fallocate will return EINVAL or + * EOPNOTSUPP. In this case we need to fall back to ftruncate */ ret = posix_fallocate(fd, 0, size); if (ret == 0) { return fd; - } else if (ret != EOPNOTSUPP) { + } else if (ret != EINVAL && ret != EOPNOTSUPP) { close(fd); errno = ret; return -1; |
