[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [BusyBox] bug#1188: df human readable bug (and patch)
From:       Adam Slattery <aslattery () sunriselinux ! com>
Date:       2001-06-29 14:20:03
[Download RAW message or body]

Package: busybox
Version: 0.51
(latest cvs snapshot - Jun 29 06:00)


busybox df shows:
 /dev/ide/host0/bus0/target0/lun0/part2  1.9M  883k  983k 47% /usr

fileutils df shows:
 /dev/ide/host0/bus0/target0/lun0/part2  1.9G  883M  983M  47% /usr

Obviously this isn't good :).
The patch to make df use make_human_readable_str correctly is simple.
Just remove the /KILOBYTE from the call to make_human_readable_str.

Note that this reveals a problem in make_human_readable_str where it
doesn't handle really large numbers (ie instead of 1.9GB it will display
inf). This is a completely differant bug though.


Adam Slattery
Sunrise Linux Development Team
aslattery@sunriselinux.com



--- df.c        Fri Jun 29 15:10:52 2001
+++ df.c.patched        Fri Jun 29 15:11:05 2001
@@ -63,13 +63,13 @@
                }
 #ifdef BB_FEATURE_HUMAN_READABLE
 printf("%-20s %9s ", device,
-make_human_readable_str(s.f_blocks, s.f_bsize/KILOBYTE, df_disp_hr));
+make_human_readable_str(s.f_blocks, s.f_bsize, df_disp_hr));

 printf("%9s ",
-make_human_readable_str( (s.f_blocks - s.f_bfree), s.f_bsize/KILOBYTE,
df_disp_hr));
+make_human_readable_str( (s.f_blocks - s.f_bfree), s.f_bsize,
df_disp_hr));

 printf("%9s %3ld%% %s\n",
-make_human_readable_str(s.f_bavail, s.f_bsize/KILOBYTE, df_disp_hr),
+make_human_readable_str(s.f_bavail, s.f_bsize, df_disp_hr),
 blocks_percent_used, mount_point);
 #else
                printf("%-20s %9ld %9ld %9ld %3ld%% %s\n",






[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic