+ if (s.f_blocks > 0) {
+ blocks_used = s.f_blocks - s.f_bfree;
+ blocks_percent_used = (long)
+ (blocks_used * 100.0 / (blocks_used + s.f_bavail) + 0.5);
+ if (strcmp(device, "/dev/root") == 0) {
+ /* Adjusts device to be the real root device,
+ * or leaves device alone if it can't find it */
+ find_real_root_device_name( device);
+ }
+ printf("%-20s %9ld %9ld %9ld %3ld%% %s\n",
+ device,
+ (long) (s.f_blocks * (s.f_bsize / 1024.0)),
+ (long) ((s.f_blocks - s.f_bfree) * (s.f_bsize / 1024.0)),
+ (long) (s.f_bavail * (s.f_bsize / 1024.0)),
+ blocks_percent_used, mountPoint);