From 4fa89f9104b0b08c146a2f35d3d65a3ee8a0a262 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Wed, 14 Mar 2007 11:43:42 +0000 Subject: [PATCH] Apparently fixed filesystems blocks to bytes ratio --- src/df.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/df.c b/src/df.c index 9ede901..ecb2dcb 100644 --- a/src/df.c +++ b/src/df.c @@ -68,11 +68,10 @@ static int _df_mtab(Prefs * prefs) static void _df_print(Prefs * prefs, const struct statvfs * f) { - int mod; + unsigned long long mod; - mod = f->f_bsize / ((*prefs & PREFS_k) ? 1024 : 512); - /* FIXME round up "Use%" result */ - printf("%-11s %10lu %10lu %10lu %7lu%% %s\n", f->f_mntfromname , + mod = f->f_bsize / ((*prefs & PREFS_k) ? 8192 : 4096); + printf("%-11s %10llu %10llu %10llu %7llu%% %s\n", f->f_mntfromname, f->f_blocks * mod, (f->f_blocks - f->f_bfree) * mod, f->f_bavail * mod, ((f->f_blocks - f->f_bfree) * 100) / ((f->f_blocks - f->f_bfree) + f->f_bavail),