diff --git a/x11/libxkbcommon/files/patch-tools_interactive-wayland.c b/x11/libxkbcommon/files/patch-tools_interactive-wayland.c new file mode 100644 index 000000000..48b4d288a --- /dev/null +++ b/x11/libxkbcommon/files/patch-tools_interactive-wayland.c @@ -0,0 +1,33 @@ +--- tools/interactive-wayland.c.orig 2021-04-07 16:27:51 UTC ++++ tools/interactive-wayland.c +@@ -180,21 +180,25 @@ os_create_anonymous_file(off_t size) + if (fd < 0) + return -1; + +-#ifdef HAVE_POSIX_FALLOCATE ++#ifdef HAVE_POSIX_FALLOCATE ++ /* Filesystems that do not support posix_fallocate() ++ * will return EINVAL or EOPNOTSUPP, fallback to ++ * ftruncate() then ++ */ + ret = posix_fallocate(fd, 0, size); +- if (ret != 0) { ++ if (ret != 0 && ret != EINVAL && ret != EOPNOTSUPP) { + close(fd); + errno = ret; + return -1; + } +-#else ++ if (ret != 0) ++#endif + ret = ftruncate(fd, size); + if (ret < 0) { + close(fd); ++ errno = ret; + return -1; + } +-#endif +- + return fd; + } +