I tracked down bug 1192739 to some code in 'df.c' which lumps Linux in
with AIX, SCO and Cray as lacking a 'f_bavail' member of its statfs
struct. Linux (at least, all the linuxes I have access to) does have
f_bavail, so the following patch makes sense. It also appears to work,
the relevant -d2 output is
GetDiskUsage(/) = 4251556/22
Free space above 1024000, defining
Which matches my df output:
/dev/hda2 20161204 14885508 4251556 78% /
--
- Eric Sorenson - N37 17.255 W121 55.738 - http://eric.explosive.net -
- Personal colo with a professional touch - http://www.explosive.net -
Index: df.c
===================================================================
--- df.c (revision 75)
+++ df.c (working copy)
@@ -118,12 +118,18 @@
avail = (buf.f_bavail * buf.f_frsize) / blocksize;
#endif
-#if defined AIX || defined SCO || defined CFCRAY || defined LINUX
+#if defined AIX || defined SCO || defined CFCRAY
total = buf.f_blocks * ((float)buf.f_bsize / blocksize);
used = (buf.f_blocks - buf.f_bfree) * ((float)buf.f_bsize / blocksize);
avail = buf.f_bfree * ((float)buf.f_bsize / blocksize);
#endif
+#if defined LINUX
+ total = buf.f_blocks * ((float)buf.f_bsize / blocksize);
+ used = (buf.f_blocks - buf.f_bfree) * ((float)buf.f_bsize / blocksize);
+ avail = buf.f_bavail * ((float)buf.f_bsize / blocksize);
+#endif
+
#if defined IRIX
/* Float fix by [EMAIL PROTECTED] */
total = buf.f_blocks * ((float)buf.f_bsize / blocksize);
_______________________________________________
Bug-cfengine mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-cfengine