]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
findmnt: use st.st_bavail for available column
authorDave Reisner <dreisner@archlinux.org>
Mon, 20 Aug 2012 10:06:17 +0000 (06:06 -0400)
committerKarel Zak <kzak@redhat.com>
Tue, 4 Sep 2012 10:43:28 +0000 (12:43 +0200)
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 <dreisner@archlinux.org>
misc-utils/findmnt.c

index db40323e368ee166a21fc611c98b1beb861085d5..853fae071e92f57a1efba20d0316e5c0595d771b 100644 (file)
@@ -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);