stat: avoid compilation failure on AIX 7.x
authorJim Meyering <meyering@redhat.com>
Thu, 8 Sep 2011 09:52:55 +0000 (11:52 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 8 Sep 2011 10:16:17 +0000 (12:16 +0200)
* 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

m4/stat-prog.m4
src/stat.c

index c23fb1f..032e310 100644 (file)
@@ -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])
index 535e141..1203651 100644 (file)
@@ -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
 # 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