From d34ef017798d50afabf2ff1cb47cc44bf0c0d9cc Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 10 May 2013 20:46:36 -0600 Subject: [PATCH] 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 ... * src/util/virfile.c (includes): ...to the file that uses mmap. Signed-off-by: Eric Blake --- src/util/virfile.c | 3 +++ src/util/virutil.c | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 1491f27ada..a59d67d5e1 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -39,6 +39,9 @@ # include #endif #include +#if HAVE_MMAP +# include +#endif #if defined(__linux__) && HAVE_DECL_LO_FLAGS_AUTOCLEAR # include diff --git a/src/util/virutil.c b/src/util/virutil.c index 43814dfd2f..3c0a48131d 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -36,9 +36,6 @@ #include #include #include -#if HAVE_MMAP -# include -#endif #include #include #include -- GitLab