From: Jim Meyering Date: Mon, 26 May 2003 20:23:14 +0000 (+0000) Subject: Fix portability problem on FreeBSD5.0: don't include X-Git-Tag: v5.0.1~441 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e4ac725a11b6e8cc5b1e1f7f30a118d073e2dc89;p=thirdparty%2Fcoreutils.git Fix portability problem on FreeBSD5.0: don't include on systems without HAVE_STRUCT_STATVFS_F_BASETYPE. Use #if/#elif/... cascade so we get only one set of include files. --- diff --git a/src/stat.c b/src/stat.c index 841cffa093..af19a17bea 100644 --- a/src/stat.c +++ b/src/stat.c @@ -25,24 +25,22 @@ #include #include #include -#if HAVE_SYS_STATVFS_H -# include -#endif #if HAVE_SYS_VFS_H # include -#endif - -#if !HAVE_SYS_STATVFS_H && !HAVE_SYS_VFS_H -# if HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H +#elif HAVE_SYS_STATVFS_H && HAVE_STRUCT_STATVFS_F_BASETYPE +# include +#elif HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H +/* NOTE: freebsd5.0 needs sys/param.h and sys/mount.h for statfs. + It does have statvfs.h, but shouldn't use it, since it doesn't + HAVE_STRUCT_STATVFS_F_BASETYPE. So find a clean way to fix it. */ /* NetBSD 1.5.2 needs these, for the declaration of struct statfs. */ -# include -# include -# elif HAVE_NETINET_IN_H && HAVE_NFS_NFS_CLNT_H && HAVE_NFS_VFS_H +# include +# include +#elif HAVE_NETINET_IN_H && HAVE_NFS_NFS_CLNT_H && HAVE_NFS_VFS_H /* Ultrix 4.4 needs these for the declaration of struct statfs. */ -# include -# include -# include -# endif +# include +# include +# include #endif #include "system.h"