From: Jim Meyering Date: Thu, 8 Sep 2011 09:52:55 +0000 (+0200) Subject: stat: avoid compilation failure on AIX 7.x X-Git-Tag: v8.13~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5581bf28e364425046d7f793f02db8721ae98216;p=thirdparty%2Fcoreutils.git stat: avoid compilation failure on AIX 7.x * src/stat.c (USE_STATVFS): Adjust definition so that it is enabled also on AIX 7.x systems that provide statvfs64 and no statvfs. [USE_STATVFS && ! STAT_STATVFS && STAT_STATVFS64] (STATFS): Define to statvfs64 in that precise case. * m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Adjust the condition here to match the new one in stat.c, to keep them in sync. Reported by Bruno Haible. For details, see http://article.gmane.org/gmane.comp.gnu.coreutils.general/1668 --- diff --git a/m4/stat-prog.m4 b/m4/stat-prog.m4 index c23fb1fbe7..032e310acd 100644 --- a/m4/stat-prog.m4 +++ b/m4/stat-prog.m4 @@ -1,4 +1,4 @@ -# stat-prog.m4 serial 6 +# stat-prog.m4 serial 7 # Record the prerequisites of src/stat.c from the coreutils package. # Copyright (C) 2002-2004, 2006, 2008-2011 Free Software Foundation, Inc. @@ -53,7 +53,8 @@ AC_INCLUDES_DEFAULT " dnl Keep this long conditional in sync with the USE_STATVFS conditional dnl in ../src/stat.c. - if test "$fu_cv_sys_stat_statvfs" = yes && + if case "$fu_cv_sys_stat_statvfs$fu_cv_sys_stat_statvfs64" in + *yes*) ;; *) false;; esac && { AC_CHECK_MEMBERS([struct statvfs.f_basetype],,, [$statvfs_includes]) test $ac_cv_member_struct_statvfs_f_basetype = yes || { AC_CHECK_MEMBERS([struct statvfs.f_fstypename],,, [$statvfs_includes]) diff --git a/src/stat.c b/src/stat.c index 535e141849..120365137e 100644 --- a/src/stat.c +++ b/src/stat.c @@ -20,7 +20,7 @@ /* Keep this conditional in sync with the similar conditional in ../m4/stat-prog.m4. */ -#if (STAT_STATVFS \ +#if ((STAT_STATVFS || STAT_STATVFS64) \ && (HAVE_STRUCT_STATVFS_F_BASETYPE || HAVE_STRUCT_STATVFS_F_FSTYPENAME \ || (! HAVE_STRUCT_STATFS_F_FSTYPENAME && HAVE_STRUCT_STATVFS_F_TYPE))) # define USE_STATVFS 1 @@ -80,7 +80,11 @@ # if HAVE_STRUCT_STATVFS_F_NAMEMAX # define SB_F_NAMEMAX(S) ((S)->f_namemax) # endif -# define STATFS statvfs +# if ! STAT_STATVFS && STAT_STATVFS64 +# define STATFS statvfs64 +# else +# define STATFS statvfs +# endif # define STATFS_FRSIZE(S) ((S)->f_frsize) #else # define HAVE_STRUCT_STATXFS_F_TYPE HAVE_STRUCT_STATFS_F_TYPE