From a2c3c34b44b866440a152511e682c98879ee13b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 8 Mar 2016 20:05:33 +0800 Subject: [PATCH] xwayland: Correctly detect whether posix_fallocate exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Julien Cristau --- configure.ac | 3 ++- hw/xwayland/xwayland-shm.c | 4 ++++ include/dix-config.h.in | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index c16684159..2c70cda30 100644 --- a/configure.ac +++ b/configure.ac @@ -218,7 +218,8 @@ AC_SUBST(DLOPEN_LIBS) dnl Checks for library functions. AC_CHECK_FUNCS([backtrace ffs geteuid getuid issetugid getresuid \ getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \ - mmap seteuid shmctl64 strncasecmp vasprintf vsnprintf walkcontext setitimer]) + mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \ + walkcontext setitimer]) AC_REPLACE_FUNCS([reallocarray strcasecmp strcasestr strlcat strlcpy strndup]) AC_CHECK_DECLS([program_invocation_short_name], [], [], [[#include ]]) diff --git a/hw/xwayland/xwayland-shm.c b/hw/xwayland/xwayland-shm.c index 1beade9c9..e8545b3be 100644 --- a/hw/xwayland/xwayland-shm.c +++ b/hw/xwayland/xwayland-shm.c @@ -24,6 +24,10 @@ * SOFTWARE. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "xwayland.h" #include diff --git a/include/dix-config.h.in b/include/dix-config.h.in index 940d2b7e2..a164c15b5 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -521,4 +521,7 @@ /* Have setitimer support */ #undef HAVE_SETITIMER +/* Have posix_fallocate() */ +#undef HAVE_POSIX_FALLOCATE + #endif /* _DIX_CONFIG_H_ */