From 6e2eebf464a76f6a0bd6da489bd0425873956eed Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Sun, 10 Dec 2017 18:47:02 +0000 Subject: [PATCH] graphics/wayland: re-enable posix_fallocate() PR: 224226 Tested by: ? Approved by: ? --- graphics/wayland/Makefile | 2 +- .../wayland/files/patch-cursor_os-compatibility.c | 23 ++++++++++++++++++++++ .../wayland/files/patch-cursor_wayland-cursor.c | 11 +++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 graphics/wayland/files/patch-cursor_os-compatibility.c create mode 100644 graphics/wayland/files/patch-cursor_wayland-cursor.c diff --git a/graphics/wayland/Makefile b/graphics/wayland/Makefile index 81b030775a5a..4be7cee349d5 100644 --- a/graphics/wayland/Makefile +++ b/graphics/wayland/Makefile @@ -3,6 +3,7 @@ PORTNAME= wayland PORTVERSION= 1.14.0 +PORTREVISION= 1 CATEGORIES= graphics wayland MASTER_SITES= http://wayland.freedesktop.org/releases/ @@ -25,7 +26,6 @@ USE_GNOME= libxslt:build USE_LDCONFIG= yes GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-documentation -CONFIGURE_ENV= ac_cv_func_posix_fallocate=no # EINVAL for many FS on 12.0 INSTALL_TARGET= install-strip .include diff --git a/graphics/wayland/files/patch-cursor_os-compatibility.c b/graphics/wayland/files/patch-cursor_os-compatibility.c new file mode 100644 index 000000000000..e99f32142ea4 --- /dev/null +++ b/graphics/wayland/files/patch-cursor_os-compatibility.c @@ -0,0 +1,23 @@ +--- cursor/os-compatibility.c.orig 2017-08-08 18:20:52 UTC ++++ cursor/os-compatibility.c +@@ -131,18 +131,17 @@ os_create_anonymous_file(off_t size) + + #ifdef HAVE_POSIX_FALLOCATE + ret = posix_fallocate(fd, 0, size); +- if (ret != 0) { ++ if (ret != EINVAL && ret != EOPNOTSUPP) { + close(fd); + errno = ret; + return -1; + } +-#else ++#endif + ret = ftruncate(fd, size); + if (ret < 0) { + close(fd); + return -1; + } +-#endif + + return fd; + } diff --git a/graphics/wayland/files/patch-cursor_wayland-cursor.c b/graphics/wayland/files/patch-cursor_wayland-cursor.c new file mode 100644 index 000000000000..d9916ecaae27 --- /dev/null +++ b/graphics/wayland/files/patch-cursor_wayland-cursor.c @@ -0,0 +1,11 @@ +--- cursor/wayland-cursor.c.orig 2017-08-08 18:20:52 UTC ++++ cursor/wayland-cursor.c +@@ -88,7 +88,7 @@ shm_pool_resize(struct shm_pool *pool, int size) + + #ifdef HAVE_POSIX_FALLOCATE + errno = posix_fallocate(pool->fd, 0, size); +- if (errno != 0) ++ if (errno != EINVAL && errno != EOPNOTSUPP) + return 0; + #endif +