[libvirt] [PATCH 3/3] virfiletest: include linux/falloc.h

Michal Privoznik posted 3 patches 7 years, 12 months ago
[libvirt] [PATCH 3/3] virfiletest: include linux/falloc.h
Posted by Michal Privoznik 7 years, 12 months ago
On systems with older glibc including fcntl.h for getting
FALLOC_FL_PUNCH_HOLE defined is not enough. We must also include
linux/falloc.h.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 tests/virfiletest.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/virfiletest.c b/tests/virfiletest.c
index d6a526c13..d5bded00e 100644
--- a/tests/virfiletest.c
+++ b/tests/virfiletest.c
@@ -27,6 +27,10 @@
 #include "virfile.h"
 #include "virstring.h"
 
+#ifdef __linux__
+# include <linux/falloc.h>
+#endif
+
 
 #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
 static int testFileCheckMounts(const char *prefix,
-- 
2.13.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 3/3] virfiletest: include linux/falloc.h
Posted by Peter Krempa 7 years, 12 months ago
On Thu, May 18, 2017 at 15:46:46 +0200, Michal Privoznik wrote:
> On systems with older glibc including fcntl.h for getting
> FALLOC_FL_PUNCH_HOLE defined is not enough. We must also include
> linux/falloc.h.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  tests/virfiletest.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/tests/virfiletest.c b/tests/virfiletest.c
> index d6a526c13..d5bded00e 100644
> --- a/tests/virfiletest.c
> +++ b/tests/virfiletest.c
> @@ -27,6 +27,10 @@
>  #include "virfile.h"
>  #include "virstring.h"
>  
> +#ifdef __linux__
> +# include <linux/falloc.h>
> +#endif

ACK if you tweak the previous commit as described.
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list