From c5253077d86bf325d83695f4eaeba3a6d8094907 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Tue, 24 May 2016 00:19:17 +0000 Subject: [PATCH] file_ioctl.c: fix build on systems without * configure.ac (AC_CHECK_HEADERS): Add linux/fiemap.h. * file_ioctl.c: Do not include and xlat/fiemap_*.h if [!HAVE_LINUX_FIEMAP_H]. (file_ioctl): Do not parse FS_IOC_FIEMAP if [!HAVE_LINUX_FIEMAP_H]. --- configure.ac | 1 + file_ioctl.c | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 6d2d1482..c3c556ed 100644 --- a/configure.ac +++ b/configure.ac @@ -363,6 +363,7 @@ AC_CHECK_HEADERS(m4_normalize([ inttypes.h linux/bsg.h linux/falloc.h + linux/fiemap.h linux/filter.h linux/hiddev.h linux/ip_vs.h diff --git a/file_ioctl.c b/file_ioctl.c index c803576e..00391fee 100644 --- a/file_ioctl.c +++ b/file_ioctl.c @@ -28,10 +28,12 @@ #include "defs.h" #include #include -#include -#include "xlat/fiemap_flags.h" -#include "xlat/fiemap_extent_flags.h" +#ifdef HAVE_LINUX_FIEMAP_H +# include +# include "xlat/fiemap_flags.h" +# include "xlat/fiemap_extent_flags.h" +#endif #ifndef FICLONE #define FICLONE _IOW(0x94, 9, int) @@ -159,6 +161,7 @@ file_ioctl(struct tcb *tcp, const unsigned int code, const long arg) break; } +#ifdef HAVE_LINUX_FIEMAP_H case FS_IOC_FIEMAP: { struct fiemap args; struct fiemap_extent fe; @@ -221,6 +224,7 @@ file_ioctl(struct tcb *tcp, const unsigned int code, const long arg) tprints("]}"); break; } +#endif /* HAVE_LINUX_FIEMAP_H */ default: return RVAL_DECODED; -- 2.40.0