fsusage: include files needed for glibc 2.6 fallback
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 2 Jul 2012 21:24:04 +0000 (14:24 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 2 Jul 2012 21:27:23 +0000 (14:27 -0700)
* lib/fsusage.c [STAT_STATVFS || STAT_STATVFS64]:
Include <sys/param.h>, <sys/mount.h>, <sys/vfs.h>
as they are needed for the 2.6 < glibc/Linux < 2.6.36 fallback.
Problem reported by Ludovic Courtès in
<http://lists.gnu.org/archive/html/bug-gnulib/2012-07/msg00005.html>.

ChangeLog
lib/fsusage.c

index fda733e..47b1ae6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2012-07-02  Paul Eggert  <eggert@cs.ucla.edu>
 
+       fsusage: include files needed for glibc 2.6 fallback
+       * lib/fsusage.c [STAT_STATVFS || STAT_STATVFS64]:
+       Include <sys/param.h>, <sys/mount.h>, <sys/vfs.h>
+       as they are needed for the 2.6 < glibc/Linux < 2.6.36 fallback.
+       Problem reported by Ludovic Courtès in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2012-07/msg00005.html>.
+
        fsusage: avoid needless check on GNU/Linux
        * m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Omit STAT_STATFS3_OSF1 check
        on GNU/Linux systems, since it can't possibly work.
index bca78cc..e273889 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