[PATCH xserver 2/2] xwayland: Correctly detect whether posix_fallocate exists

Jonas Ådahl jadahl at gmail.com
Fri Feb 19 07:08:13 UTC 2016


We had HAVE_POSIX_FALLOCATE checks, but no such macros were ever
defined anywhere. This commit makes it so that this macro is defined if
the posix_fallocate is detected during configure.

Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
---
 configure.ac                 |  4 ++++
 hw/xwayland/xwayland-shm.c   |  4 ++++
 include/xwayland-config.h.in | 11 +++++++++++
 3 files changed, 19 insertions(+)
 create mode 100644 include/xwayland-config.h.in

diff --git a/configure.ac b/configure.ac
index 312fc69..4609172 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,6 +65,8 @@ dnl xorg-config.h covers the Xorg DDX.
 AC_CONFIG_HEADERS(include/xorg-config.h)
 dnl xkb-config.h covers XKB for the Xorg and Xnest DDXs.
 AC_CONFIG_HEADERS(include/xkb-config.h)
+dnl xwayland-config.h covers the XWayland DDX
+AC_CONFIG_HEADERS(include/xwayland-config.h)
 dnl xwin-config.h covers the XWin DDX.
 AC_CONFIG_HEADERS(include/xwin-config.h)
 dnl kdrive-config.h covers the kdrive DDX
@@ -2470,6 +2472,8 @@ if test "x$XWAYLAND" = xyes; then
 	AC_SUBST([XWAYLAND_LIBS])
 	AC_SUBST([XWAYLAND_SYS_LIBS])
 
+	AC_CHECK_FUNCS([posix_fallocate])
+
 	WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
 	AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
 		     [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
diff --git a/hw/xwayland/xwayland-shm.c b/hw/xwayland/xwayland-shm.c
index d047798..e2d39bb 100644
--- a/hw/xwayland/xwayland-shm.c
+++ b/hw/xwayland/xwayland-shm.c
@@ -24,6 +24,10 @@
  * SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <xwayland-config.h>
+#endif
+
 #include "xwayland.h"
 
 #include <sys/mman.h>
diff --git a/include/xwayland-config.h.in b/include/xwayland-config.h.in
new file mode 100644
index 0000000..a327419
--- /dev/null
+++ b/include/xwayland-config.h.in
@@ -0,0 +1,11 @@
+/* xwayland-config.h.in: not at all generated.                      -*- c -*- */
+
+#ifndef _XWAYLAND_CONFIG_H_
+#define _XWAYLAND_CONFIG_H_
+
+#include <dix-config.h>
+
+/* Have the posix_fallocate() function. */
+#undef HAVE_POSIX_FALLOCATE
+
+#endif /* _XWAYLAND_CONFIG_H_ */
-- 
2.4.3



More information about the xorg-devel mailing list