- status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir);
- if (status != 0)
- exit(status);
- argc--;
- argv++;
- }
- exit(TRUE);
- } else {
- FILE *mountTable;
- struct mntent *mountEntry;
-
- mountTable = setmntent(mtab_file, "r");
- if (mountTable == 0) {
- perror(mtab_file);
- exit(FALSE);
- }
+ blocks_used = s.f_blocks - s.f_bfree;
+ blocks_percent_used = 0;
+ if (blocks_used + s.f_bavail) {
+ blocks_percent_used = (blocks_used * 100ULL
+ + (blocks_used + s.f_bavail)/2
+ ) / (blocks_used + s.f_bavail);
+ }
+
+#ifdef WHY_IT_SHOULD_BE_HIDDEN
+ if (strcmp(device, "rootfs") == 0) {
+ continue;
+ }
+#endif
+#ifdef WHY_WE_DO_IT_FOR_DEV_ROOT_ONLY
+/* ... and also this is the only user of find_block_device */
+ if (strcmp(device, "/dev/root") == 0) {
+ /* Adjusts device to be the real root device,
+ * or leaves device alone if it can't find it */
+ device = find_block_device("/");
+ if (!device) {
+ goto SET_ERROR;
+ }
+ }
+#endif
+
+ if (printf("\n%-20s" + 1, device) > 20)
+ printf("\n%-20s", "");
+#if ENABLE_FEATURE_HUMAN_READABLE
+ printf(" %9s ",
+ make_human_readable_str(s.f_blocks, s.f_bsize, df_disp_hr));