1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

build: fix use of mmap

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>
This commit is contained in:
Eric Blake 2013-05-10 20:46:36 -06:00
parent 12bd22c70d
commit d34ef01779
2 changed files with 3 additions and 3 deletions

View 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>

View 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>