From 64311a1e0dd8cc8a0e04ba99e0c1eb50e769909b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 1 Sep 2006 19:49:22 +0000 Subject: [PATCH] * lib/mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by HAVE_STRUCT_STATFS_F_FSTYPENAME. * m4/fstypename.m4 (gl_FSTYPENAME): Use AC_CHECK_MEMBERS instead of doing all the work ourselves. * m4/fsusage.m4 (gl_PREREQ_FSUSAGE_EXTRA): Don't check for sys/statvfs.h since the code doesn't use HAVE_SYS_STATVFS_H. --- lib/ChangeLog | 5 +++++ lib/mountlist.c | 6 +++--- m4/ChangeLog | 7 +++++++ m4/fstypename.m4 | 37 +++++++++++-------------------------- m4/fsusage.m4 | 4 ++-- 5 files changed, 28 insertions(+), 31 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 448b0b133..20ca894e8 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2006-09-01 Paul Eggert + + * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by + HAVE_STRUCT_STATFS_F_FSTYPENAME. + 2006-08-31 Paul Eggert * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h diff --git a/lib/mountlist.c b/lib/mountlist.c index 1b6424101..285c3de5e 100644 --- a/lib/mountlist.c +++ b/lib/mountlist.c @@ -170,7 +170,7 @@ char *strstr (); #if MOUNTED_GETMNTINFO -# if ! HAVE_F_FSTYPENAME_IN_STATFS +# if ! HAVE_STRUCT_STATFS_F_FSTYPENAME static char * fstype_to_string (short int t) { @@ -264,12 +264,12 @@ fstype_to_string (short int t) return "?"; } } -# endif /* ! HAVE_F_FSTYPENAME_IN_STATFS */ +# endif static char * fsp_to_string (const struct statfs *fsp) { -# if defined HAVE_F_FSTYPENAME_IN_STATFS +# if HAVE_STRUCT_STATFS_F_FSTYPENAME return (char *) (fsp->f_fstypename); # else return fstype_to_string (fsp->f_type); diff --git a/m4/ChangeLog b/m4/ChangeLog index 4a273483c..9fc689af7 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,10 @@ +2006-09-01 Paul Eggert + + * fstypename.m4 (gl_FSTYPENAME): Use AC_CHECK_MEMBERS instead + of doing all the work ourselves. + * fsusage.m4 (gl_PREREQ_FSUSAGE_EXTRA): Don't check for + sys/statvfs.h since the code doesn't use HAVE_SYS_STATVFS_H. + 2006-08-31 Paul Eggert * fnmatch.m4: Add comment that Autoconf AC_FUNC_FNMATCH is diff --git a/m4/fstypename.m4 b/m4/fstypename.m4 index 7ff33e20a..aa676f3ae 100644 --- a/m4/fstypename.m4 +++ b/m4/fstypename.m4 @@ -1,37 +1,22 @@ -#serial 5 +#serial 6 dnl From Jim Meyering. dnl dnl See if struct statfs has the f_fstypename member. -dnl If so, define HAVE_F_FSTYPENAME_IN_STATFS. +dnl If so, define HAVE_STRUCT_STATFS_F_FSTYPENAME. dnl -# Copyright (C) 1998, 1999, 2001, 2004 Free Software Foundation, Inc. +# Copyright (C) 1998, 1999, 2001, 2004, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FSTYPENAME], - [ - AC_CACHE_CHECK([for f_fstypename in struct statfs], - fu_cv_sys_f_fstypename_in_statfs, - [ - AC_TRY_COMPILE( - [ -#include -#include -#include - ], - [struct statfs s; int i = sizeof s.f_fstypename;], - fu_cv_sys_f_fstypename_in_statfs=yes, - fu_cv_sys_f_fstypename_in_statfs=no - ) - ] - ) - - if test $fu_cv_sys_f_fstypename_in_statfs = yes; then - AC_DEFINE(HAVE_F_FSTYPENAME_IN_STATFS, 1, - [Define if struct statfs has the f_fstypename member.]) - fi - ] -) +[ + AC_CHECK_MEMBERS([struct statfs.f_fstypename],,, + [ + #include + #include + #include + ]) +]) diff --git a/m4/fsusage.m4 b/m4/fsusage.m4 index 23116b5f2..3ac996507 100644 --- a/m4/fsusage.m4 +++ b/m4/fsusage.m4 @@ -1,4 +1,4 @@ -#serial 19 +#serial 20 # Obtaining file system usage information. # Copyright (C) 1997, 1998, 2000, 2001, 2003, 2004, 2005, 2006 Free Software @@ -259,6 +259,6 @@ choke -- this is a workaround for a Sun-specific problem # Prerequisites of lib/fsusage.c not done by gl_FILE_SYSTEM_USAGE. AC_DEFUN([gl_PREREQ_FSUSAGE_EXTRA], [ - AC_CHECK_HEADERS(dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h sys/statvfs.h) + AC_CHECK_HEADERS(dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h) gl_STATFS_TRUNCATES ]) -- 2.11.0