summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2020-04-28 19:51:20 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-04-28 19:51:20 +0000
commit0fa08a6c46cdee80aa054e27fec121808e6bb4e1 (patch)
treedd4ed4f55de937e63bdd649a4e29a2c5bf819703
parent62a8e9a84245b43458c4aea406c41b9d7c0f17a6 (diff)
parentb0ad11e60a26c1f791ba0d9584e83b5a59720b44 (diff)
downloadfsck_msdos-android11-qpr1-s2-release.tar.gz
Change-Id: I52bbe5e34f427aa1ff3c8d827e9731f8ddd55e01
-rw-r--r--check.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/check.c b/check.c
index f2e896b..9519315 100644
--- a/check.c
+++ b/check.c
@@ -54,6 +54,8 @@ checkfilesys(const char *fname)
int finish_dosdirsection=0;
int mod = 0;
int ret = 8;
+ int64_t freebytes;
+ int64_t badbytes;
rdonly = alwaysno;
if (!preen)
@@ -129,37 +131,33 @@ checkfilesys(const char *fname)
mod |= FSERROR;
}
+ freebytes = (int64_t)boot.NumFree * boot.ClusterSize;
+ badbytes = (int64_t)boot.NumBad * boot.ClusterSize;
+
#ifdef HAVE_LIBUTIL_H
char freestr[7], badstr[7];
- int64_t freebytes = boot.NumFree * boot.ClusterSize;
humanize_number(freestr, sizeof(freestr), freebytes, "",
HN_AUTOSCALE, HN_DECIMAL | HN_IEC_PREFIXES);
if (boot.NumBad) {
- int64_t badbytes = boot.NumBad * boot.ClusterSize;
-
humanize_number(badstr, sizeof(badstr), badbytes, "",
HN_AUTOSCALE, HN_B | HN_DECIMAL | HN_IEC_PREFIXES);
pwarn("%d files, %sB free (%d clusters), %sB bad (%d clusters)\n",
- boot.NumFiles,
- freestr, boot.NumFree,
+ boot.NumFiles, freestr, boot.NumFree,
badstr, boot.NumBad);
} else {
pwarn("%d files, %sB free (%d clusters)\n",
- boot.NumFiles,
- freestr, boot.NumFree);
+ boot.NumFiles, freestr, boot.NumFree);
}
#else
if (boot.NumBad)
- pwarn("%d files, %d KiB free (%d clusters), %d KiB bad (%d clusters)\n",
- boot.NumFiles,
- boot.NumFree * boot.ClusterSize / 1024, boot.NumFree,
- boot.NumBad * boot.ClusterSize / 1024, boot.NumBad);
+ pwarn("%d files, %jd KiB free (%d clusters), %jd KiB bad (%d clusters)\n",
+ boot.NumFiles, (intmax_t)freebytes / 1024, boot.NumFree,
+ (intmax_t)badbytes / 1024, boot.NumBad);
else
- pwarn("%d files, %d KiB free (%d clusters)\n",
- boot.NumFiles,
- boot.NumFree * boot.ClusterSize / 1024, boot.NumFree);
+ pwarn("%d files, %jd KiB free (%d clusters)\n",
+ boot.NumFiles, (intmax_t)freebytes / 1024, boot.NumFree);
#endif
if (mod && (mod & FSERROR) == 0) {