mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
* src/stat.c (HAVE_STRUCT_STATXFS_F_FSID_VAL, FSID_VAL): New macros, to
work around a Mac OS X porting problem reported by Bruno Haible in <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00308.html>. (print_statfs): Use them. * m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Check for __val versus val components of fsid. Omit some checks that stat.c doesn't care about.
This commit is contained in:
1 parent
bc7aa2329c
commit
ddb97ab3b1
4 files changed
+50
-16
No files matched your search
@@ -1,5 +1,10 @@
|
||||
2006-08-29 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* src/stat.c (HAVE_STRUCT_STATXFS_F_FSID_VAL, FSID_VAL): New macros, to
|
||||
work around a Mac OS X porting problem reported by Bruno Haible in
|
||||
<http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00308.html>.
|
||||
(print_statfs): Use them.
|
||||
|
||||
* bootstrap.conf (gnulib_modules): Add isapipe.
|
||||
* src/tail.c: Include isapipe.h.
|
||||
(IS_PIPE_LIKE_FILE_TYPE): Remove.
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2006-08-29 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* stat-prog.m4 (cu_PREREQ_STAT_PROG): Check for __val versus val
|
||||
components of fsid. Omit some checks that stat.c doesn't care
|
||||
about.
|
||||
|
||||
2006-08-26 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* .cvsignore: Add config-h.m4.
|
||||
|
||||
+23
-11
@@ -52,16 +52,28 @@ $ac_includes_default
|
||||
# endif
|
||||
#endif
|
||||
"
|
||||
AC_CHECK_MEMBERS([struct statfs.f_basetype],,,[$statxfs_includes])
|
||||
AC_CHECK_MEMBERS([struct statvfs.f_basetype],,,[$statxfs_includes])
|
||||
AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$statxfs_includes])
|
||||
AC_CHECK_MEMBERS([struct statvfs.f_fstypename],,,[$statxfs_includes])
|
||||
AC_CHECK_MEMBERS([struct statfs.f_type],,,[$statxfs_includes])
|
||||
AC_CHECK_MEMBERS([struct statvfs.f_type],,,[$statxfs_includes])
|
||||
AC_CHECK_MEMBERS([struct statfs.f_fsid.__val],,,[$statxfs_includes])
|
||||
AC_CHECK_MEMBERS([struct statvfs.f_fsid.__val],,,[$statxfs_includes])
|
||||
AC_CHECK_MEMBERS([struct statfs.f_namemax],,,[$statxfs_includes])
|
||||
AC_CHECK_MEMBERS([struct statvfs.f_namemax],,,[$statxfs_includes])
|
||||
AC_CHECK_MEMBERS([struct statfs.f_namelen],,,[$statxfs_includes])
|
||||
AC_CHECK_MEMBERS([struct statvfs.f_namelen],,,[$statxfs_includes])
|
||||
dnl Keep this long conditional in sync with the USE_STATVFS conditional
|
||||
dnl in ../src/stat.c.
|
||||
if test $ac_cv_header_sys_statvfs_h = yes &&
|
||||
{ AC_CHECK_MEMBERS(
|
||||
[struct statvfs.f_basetype,
|
||||
struct statvfs.f_fstypename,
|
||||
struct statvfs.f_type],,,
|
||||
[$statxfs_includes])
|
||||
test $ac_cv_member_struct_statvfs_f_basetype = yes ||
|
||||
test $ac_cv_member_struct_statvfs_f_fstypename = yes ||
|
||||
{ test $ac_cv_member_struct_statvfs_f_type = yes &&
|
||||
test $ac_cv_member_struct_statfs_f_fstypename != yes; }; }; then
|
||||
AC_CHECK_MEMBERS(
|
||||
[struct statvfs.f_fsid.__val, struct statvfs.f_fsid.val,
|
||||
struct statvfs.f_namelen, struct statvfs.f_namemax],,,
|
||||
[$statxfs_includes])
|
||||
else
|
||||
AC_CHECK_MEMBERS(
|
||||
[struct statfs.f_basetype, struct statfs.f_fsid.__val,
|
||||
struct statfs.f_fsid.val, struct statfs.f_namelen,
|
||||
struct statfs.f_namemax, struct statfs.f_type],,,
|
||||
[$statxfs_includes])
|
||||
fi
|
||||
])
|
||||
+16
-5
@@ -19,6 +19,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Keep this conditional in sync with the similar conditional in
|
||||
../m4/stat-prog.m4. */
|
||||
#if (STAT_STATVFS \
|
||||
&& (HAVE_STRUCT_STATVFS_F_BASETYPE || HAVE_STRUCT_STATVFS_F_FSTYPENAME \
|
||||
|| (! HAVE_STRUCT_STATFS_F_FSTYPENAME && HAVE_STRUCT_STATVFS_F_TYPE)))
|
||||
@@ -69,6 +71,7 @@
|
||||
#if USE_STATVFS
|
||||
# define STRUCT_STATVFS struct statvfs
|
||||
# define HAVE_STRUCT_STATXFS_F_FSID___VAL HAVE_STRUCT_STATVFS_F_FSID___VAL
|
||||
# define HAVE_STRUCT_STATXFS_F_FSID_VAL HAVE_STRUCT_STATVFS_F_FSID_VAL
|
||||
# define HAVE_STRUCT_STATXFS_F_TYPE HAVE_STRUCT_STATVFS_F_TYPE
|
||||
# if HAVE_STRUCT_STATVFS_F_NAMEMAX
|
||||
# define SB_F_NAMEMAX(S) ((S)->f_namemax)
|
||||
@@ -111,14 +114,22 @@ statfs (char const *filename, struct fs_info *buf)
|
||||
# define f_ffree free_nodes
|
||||
# define STRUCT_STATVFS struct fs_info
|
||||
# define HAVE_STRUCT_STATXFS_F_FSID___VAL 0
|
||||
# define HAVE_STRUCT_STATXFS_F_FSID_VAL 0
|
||||
# define STATFS_FRSIZE(S) ((S)->block_size)
|
||||
# else
|
||||
# define STRUCT_STATVFS struct statfs
|
||||
# define HAVE_STRUCT_STATXFS_F_FSID___VAL HAVE_STRUCT_STATFS_F_FSID___VAL
|
||||
# define HAVE_STRUCT_STATXFS_F_FSID_VAL HAVE_STRUCT_STATFS_F_FSID_VAL
|
||||
# define STATFS_FRSIZE(S) 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if HAVE_STRUCT_STATXFS_F_FSID___VAL
|
||||
# define FSID_VAL __val
|
||||
#elif HAVE_STRUCT_STATXFS_F_FSID_VAL
|
||||
# define FSID_VAL val
|
||||
#endif
|
||||
|
||||
#ifdef SB_F_NAMEMAX
|
||||
# define OUT_NAMEMAX out_uint
|
||||
#else
|
||||
@@ -404,13 +415,13 @@ print_statfs (char *pformat, size_t prefix_len, char m, char const *filename,
|
||||
|
||||
case 'i':
|
||||
{
|
||||
#if HAVE_STRUCT_STATXFS_F_FSID___VAL
|
||||
uintmax_t val0 = statfsbuf->f_fsid.__val[0];
|
||||
uintmax_t val1 = statfsbuf->f_fsid.__val[1];
|
||||
#ifdef FSID_VAL
|
||||
uintmax_t val0 = statfsbuf->f_fsid.FSID_VAL[0];
|
||||
uintmax_t val1 = statfsbuf->f_fsid.FSID_VAL[1];
|
||||
uintmax_t fsid =
|
||||
(val1
|
||||
+ (sizeof statfsbuf->f_fsid.__val[1] < sizeof fsid
|
||||
? val0 << (CHAR_BIT * sizeof statfsbuf->f_fsid.__val[1])
|
||||
+ (sizeof statfsbuf->f_fsid.FSID_VAL[1] < sizeof fsid
|
||||
? val0 << (CHAR_BIT * sizeof statfsbuf->f_fsid.FSID_VAL[1])
|
||||
: 0));
|
||||
#else
|
||||
uintmax_t fsid = statfsbuf->f_fsid;
|
||||
|
||||
Reference in new issue
Block a user