]> git.proxmox.com Git - mirror_qemu.git/commitdiff
memfd: fix configure test
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 28 Nov 2017 10:51:27 +0000 (11:51 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 20 Dec 2017 21:29:26 +0000 (22:29 +0100)
Recent glibc added memfd_create in sys/mman.h.  This conflicts with
the definition in util/memfd.c:

    /builddir/build/BUILD/qemu-2.11.0-rc1/util/memfd.c:40:12: error: static declaration of memfd_create follows non-static declaration

Fix the configure test, and remove the sys/memfd.h inclusion since the
file actually does not exist---it is a typo in the memfd_create(2) man
page.

Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
configure
util/memfd.c

index 9c8aa5a98bd4f7baf54dd7d75344be7487155036..99ccc1725ace3dd1e8be3e3b74c8ebd3fbd1c1eb 100755 (executable)
--- a/configure
+++ b/configure
@@ -3923,7 +3923,7 @@ fi
 # check if memfd is supported
 memfd=no
 cat > $TMPC << EOF
-#include <sys/memfd.h>
+#include <sys/mman.h>
 
 int main(void)
 {
index 4571d1aba866a67de41721aa17e4f54e0df695ef..412e94a405fc97110c4f4ce2508a04d1a5ad5ab0 100644 (file)
@@ -31,9 +31,7 @@
 
 #include "qemu/memfd.h"
 
-#ifdef CONFIG_MEMFD
-#include <sys/memfd.h>
-#elif defined CONFIG_LINUX
+#if defined CONFIG_LINUX && !defined CONFIG_MEMFD
 #include <sys/syscall.h>
 #include <asm/unistd.h>