提交 d34ef017 编写于 作者: E Eric Blake

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: NEric Blake <eblake@redhat.com>
上级 12bd22c7
......@@ -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>
......
......@@ -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>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册