fsusage: remove code not needed on non GNU/Linux systems.
authorPádraig Brady <P@draigBrady.com>
Mon, 2 Jul 2012 22:02:06 +0000 (00:02 +0200)
committerPádraig Brady <P@draigBrady.com>
Mon, 2 Jul 2012 22:03:00 +0000 (00:03 +0200)
* 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
lib/fsusage.c

index 47b1ae6..e7f7883 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index e273889..1f282e0 100644 (file)
 # 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
 # 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 */