bug-gnulib
[Top][All Lists]
Advanced

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

mountlist / fstypename / fsusage minor cleanup


From: Paul Eggert
Subject: mountlist / fstypename / fsusage minor cleanup
Date: Fri, 01 Sep 2006 12:50:52 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

I installed this minor cleanup, as it simplifies coreutils'
configuration of stat.c:

2006-09-01  Paul Eggert  <address@hidden>

        * 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.

Index: lib/mountlist.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/mountlist.c,v
retrieving revision 1.56
diff -p -u -r1.56 mountlist.c
--- lib/mountlist.c     18 Aug 2006 18:35:07 -0000      1.56
+++ lib/mountlist.c     1 Sep 2006 19:46:43 -0000
@@ -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);
Index: m4/fstypename.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/fstypename.m4,v
retrieving revision 1.7
diff -p -u -r1.7 fstypename.m4
--- m4/fstypename.m4    23 Jan 2005 08:06:57 -0000      1.7
+++ m4/fstypename.m4    1 Sep 2006 19:46:43 -0000
@@ -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 <sys/param.h>
-#include <sys/types.h>
-#include <sys/mount.h>
-         ],
-         [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 <sys/types.h>
+      #include <sys/param.h>
+      #include <sys/mount.h>
+    ])
+])
Index: m4/fsusage.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/fsusage.m4,v
retrieving revision 1.26
diff -p -u -r1.26 fsusage.m4
--- m4/fsusage.m4       23 Aug 2006 23:40:21 -0000      1.26
+++ m4/fsusage.m4       1 Sep 2006 19:46:43 -0000
@@ -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-
 # 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
 ])




reply via email to

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