From: Eric Blake Date: Sat, 11 May 2013 02:46:36 +0000 (-0600) Subject: build: fix use of mmap X-Git-Tag: CVE-2013-1962~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d34ef017798d50afabf2ff1cb47cc44bf0c0d9cc;p=thirdparty%2Flibvirt.git 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 --- 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