coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coreutils-8.12.193-d8dc8 on AIX


From: Jim Meyering
Subject: Re: coreutils-8.12.193-d8dc8 on AIX
Date: Thu, 08 Sep 2011 12:00:18 +0200

Bruno Haible wrote:
> Jim Meyering wrote:
>> > Still a compilation error on AIX 6.1 and 7.1:
>> >
>> > "stat.c", line 210.21: 1506-022 (S) "f_basetype" is not a member of
>> > "const struct statfs".
>> > "stat.c", line 1169.15: 1506-280 (W) Function argument assignment
>> > between types "char*" and "const char*" is not allowed.
>> > make: 1254-004 The error code from the last command is 1.
>> >
>> > This is the same as reported last week in
>> > <http://lists.gnu.org/archive/html/coreutils/2011-09/msg00009.html>.
>>
>> Thanks.
>> I don't yet have access to such systems.
>> In the mean time, can you send me config.status and config.log?
>
> Here are the two files, plus config.h.

Thanks!
The problem was that stat (in both configure-time test and .c code)
was not handling the case in which a statvfs64 function exists and
must be called by that name rather than by "statvfs" that is automatically
mapped to the required name.

Adding the "|| STAT_STATVFS64" disjunct and the corresponding
change to the .m4 test fixed it (along with the tweak to map
statvfs to statvfs64 in the C code).

Can you confirm that this solves the problem?


>From 124be28e71ff52101db5ac3a0f7516e69cfc4377 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 8 Sep 2011 11:52:55 +0200
Subject: [PATCH] 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
---
 m4/stat-prog.m4 |    5 +++--
 src/stat.c      |    8 ++++++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/m4/stat-prog.m4 b/m4/stat-prog.m4
index c23fb1f..032e310 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 535e141..1203651 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
--
1.7.7.rc0.362.g5a14



reply via email to

[Prev in Thread] Current Thread [Next in Thread]