]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: fix use of mmap
authorEric Blake <eblake@redhat.com>
Sat, 11 May 2013 02:46:36 +0000 (20:46 -0600)
committerEric Blake <eblake@redhat.com>
Sat, 11 May 2013 02:52:57 +0000 (20:52 -0600)
Commit bfe7721d introduced a regression, but only on platforms
like FreeBSD that lack posix_fallocate and where mmap serves as
a nice fallback for safezero.

util/virfile.c: In function 'safezero':
util/virfile.c:837: error: 'PROT_READ' undeclared (first use in this function)

* src/util/virutil.c (includes): Move use of <sys/mman.h>...
* src/util/virfile.c (includes): ...to the file that uses mmap.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/util/virfile.c
src/util/virutil.c

index 1491f27adacaed0c29707433c7386344f784c741..a59d67d5e126210cb22618c1960d3c91977d5f46 100644 (file)
@@ -39,6 +39,9 @@
 # include <mntent.h>
 #endif
 #include <stdlib.h>
+#if HAVE_MMAP
+# include <sys/mman.h>
+#endif
 
 #if defined(__linux__) && HAVE_DECL_LO_FLAGS_AUTOCLEAR
 # include <linux/loop.h>
index 43814dfd2fe9f9ac2c9c4dad70d957c94875e0cc..3c0a48131d89c0ef3593df12a766eddafdfd2e59 100644 (file)
@@ -36,9 +36,6 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/ioctl.h>
-#if HAVE_MMAP
-# include <sys/mman.h>
-#endif
 #include <string.h>
 #include <termios.h>
 #include <locale.h>