From ed6c8c1b61bf87e0fa6d78da405a052a0e46cb10 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 20 Aug 2012 06:06:17 -0400 Subject: [PATCH] findmnt: use st.st_bavail for available column This matches more closely with what 'df -h' reports as space available. Any remaining discrepancy between these 2 tools is a result of precision and choices in rounding. Signed-off-by: Dave Reisner --- misc-utils/findmnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c index db40323e36..853fae071e 100644 --- a/misc-utils/findmnt.c +++ b/misc-utils/findmnt.c @@ -374,7 +374,7 @@ static const char *get_vfs_attr(struct libmnt_fs *fs, int sizetype) vfs_attr = buf.f_frsize * buf.f_blocks; break; case COL_AVAIL: - vfs_attr = buf.f_frsize * buf.f_bfree; + vfs_attr = buf.f_frsize * buf.f_bavail; break; case COL_USED: vfs_attr = buf.f_frsize * (buf.f_blocks - buf.f_bfree); -- 2.47.3