changeset 16961:1ba5ea17c907

fsusage: remove code not needed on non GNU/Linux systems. * lib/fsusage.c [STAT_STATVFS || STAT_STATVFS64]: Don't include headers no longer needed in this case. * lib/fsusage.c [STAT_STATVFS && ! (__linux__ && (__GLIBC__||__UCLIBC__))]: Undefine STAT_STATFS2_FRSIZE to exclude code not used in this case.
author Pádraig Brady <P@draigBrady.com>
date Tue, 03 Jul 2012 00:02:06 +0200
parents 83a4d2fe0879
children 5cf5743467da
files ChangeLog lib/fsusage.c
diffstat 2 files changed, 21 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jul 02 14:24:04 2012 -0700
+++ b/ChangeLog	Tue Jul 03 00:02:06 2012 +0200
@@ -1,3 +1,13 @@
+2012-07-02  Pádraig Brady  <P@draigBrady.com>
+
+	fsusage: remove code not needed on non GNU/Linux systems.
+
+	* lib/fsusage.c [STAT_STATVFS || STAT_STATVFS64]:
+	Don't include headers no longer needed in this case.
+	* lib/fsusage.c [STAT_STATVFS &&
+	! (__linux__ && (__GLIBC__||__UCLIBC__))]: Undefine
+	STAT_STATFS2_FRSIZE to exclude code not used in this case.
+
 2012-07-02  Paul Eggert  <eggert@cs.ucla.edu>
 
 	fsusage: include files needed for glibc 2.6 fallback
--- a/lib/fsusage.c	Mon Jul 02 14:24:04 2012 -0700
+++ b/lib/fsusage.c	Tue Jul 03 00:02:06 2012 +0200
@@ -31,6 +31,15 @@
 # include <fcntl.h>
 # include <unistd.h>
 # include <sys/stat.h>
+#if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+#if HAVE_SYS_MOUNT_H
+# include <sys/mount.h>
+#endif
+#if HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+#endif
 # if HAVE_SYS_FS_S5PARAM_H      /* Fujitsu UXP/V */
 #  include <sys/fs/s5param.h>
 # endif
@@ -46,18 +55,6 @@
 # include "full-read.h"
 #endif
 
-/* These files are needed for 2.6 < glibc/Linux < 2.6.36, even though
-   it has statvfs, because they are used by the fallback.  */
-#if HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-#if HAVE_SYS_MOUNT_H
-# include <sys/mount.h>
-#endif
-#if HAVE_SYS_VFS_H
-# include <sys/vfs.h>
-#endif
-
 /* The results of open() in this file are not used with fchdir,
    therefore save some unnecessary work in fchdir.c.  */
 #undef open
@@ -93,6 +90,8 @@
    preceding entries in /proc/mounts; that makes df hang if even one
    of the corresponding file systems is hard-mounted but not available.  */
 # if ! (__linux__ && (__GLIBC__ || __UCLIBC__))
+/* The FRSIZE fallback is not required in this case.  */
+#  undef STAT_STATFS2_FRSIZE
 static int statvfs_works (void) { return 1; }
 # else
 #  include <string.h> /* for strverscmp */