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..3d9ebccc4 --- /dev/null +++ b/x11/libxkbcommon/files/patch-tools_interactive-wayland.c @@ -0,0 +1,32 @@ +--- tools/interactive-wayland.c.orig 2021-04-07 16:27:51 UTC ++++ tools/interactive-wayland.c +@@ -181,20 +181,26 @@ os_create_anonymous_file(off_t size) + return -1; + + #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; + } ++ if (ret != 0) ++ ret = ftruncate(fd, size); + #else + ret = ftruncate(fd, size); ++#endif + if (ret < 0) { + close(fd); ++ errno = ret; + return -1; + } +-#endif +- + return fd; + } +