From 2ab2617ee340ff35a9a4c713004fb302868d41b0 Mon Sep 17 00:00:00 2001
From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Tue, 3 Jul 2012 00:02:06 +0200
Subject: [PATCH] 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.
---
ChangeLog | 10 ++++++++++
lib/fsusage.c | 23 +++++++++++------------
2 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 47b1ae64f..e7f788309 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-07-02 Pádraig Brady
+
+ 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
fsusage: include files needed for glibc 2.6 fallback
diff --git a/lib/fsusage.c b/lib/fsusage.c
index e273889e3..1f282e0d2 100644
--- a/lib/fsusage.c
+++ b/lib/fsusage.c
@@ -31,6 +31,15 @@
# include
# include
# include
+#if HAVE_SYS_PARAM_H
+# include
+#endif
+#if HAVE_SYS_MOUNT_H
+# include
+#endif
+#if HAVE_SYS_VFS_H
+# include
+#endif
# if HAVE_SYS_FS_S5PARAM_H /* Fujitsu UXP/V */
# include
# 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
-#endif
-#if HAVE_SYS_MOUNT_H
-# include
-#endif
-#if HAVE_SYS_VFS_H
-# include
-#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 /* for strverscmp */
--
2.11.0