From: Karel Zak Date: Tue, 20 Mar 2018 10:42:34 +0000 (+0100) Subject: fstrim: fix fs.h and mount.h collision X-Git-Tag: v2.32~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0357292b5faca0383ea13626d0564d4da275b06;p=thirdparty%2Futil-linux.git fstrim: fix fs.h and mount.h collision Unfortunately, old version of the file linux/fs.h defines MS_* macros, so the file cannot be included together with sys/mount.h. We include sys/mount.h from libmount.h now. Signed-off-by: Karel Zak --- diff --git a/configure.ac b/configure.ac index f828ae59b8..0dbabf5d18 100644 --- a/configure.ac +++ b/configure.ac @@ -280,6 +280,16 @@ AC_CHECK_HEADERS([ \ utmpx.h \ ]) +# There is a collision in old kernel-headers. The both files mount.h and fs.h +# define MS_* macros. Fixed by kernel commit e462ec50cb5fad19f6003a3d8087f4a0945dd2b1. +# +AC_CHECK_HEADERS([linux/fs.h ], [], [], + [#ifdef HAVE_SYS_MOUNT_H + # include + # include + #endif +]) + AC_CHECK_HEADERS([linux/gsmmux.h ], [], [], [#ifdef LINUX_GSMMUX_H # include @@ -306,7 +316,6 @@ AC_CHECK_HEADERS([langinfo.h], [AM_CONDITIONAL([HAVE_LANGINFO], [true])], [AM_CONDITIONAL([HAVE_LANGINFO], [false])]) - AC_MSG_CHECKING([whether langinfo.h defines ALTMON_x constants]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include diff --git a/sys-utils/fstrim.c b/sys-utils/fstrim.c index 98708d533e..ca8cf256de 100644 --- a/sys-utils/fstrim.c +++ b/sys-utils/fstrim.c @@ -35,7 +35,10 @@ #include #include -#include + +#ifdef HAVE_SYS_FS_H +# include +#endif #include "nls.h" #include "strutils.h"