summaryrefslogtreecommitdiff
path: root/lib/fsusage.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2012-07-03 00:02:06 +0200
committerPádraig Brady <P@draigBrady.com>2012-07-03 00:03:00 +0200
commit2ab2617ee340ff35a9a4c713004fb302868d41b0 (patch)
tree1c8d101c65e12c7b118bf0cdbc45fff100ee1d92 /lib/fsusage.c
parentdefe57376249c1385b2874b43307e4c686a1d38c (diff)
downloadgnulib-2ab2617ee340ff35a9a4c713004fb302868d41b0.tar.gz
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.
Diffstat (limited to 'lib/fsusage.c')
-rw-r--r--lib/fsusage.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/fsusage.c b/lib/fsusage.c
index e273889e3f..1f282e0d22 100644
--- a/lib/fsusage.c
+++ b/lib/fsusage.c
@@ -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 */