Page MenuHomeFreeBSD

D23050.id66402.diff
No OneTemporary

D23050.id66402.diff

Index: sbin/fsck_msdosfs/Makefile
===================================================================
--- sbin/fsck_msdosfs/Makefile
+++ sbin/fsck_msdosfs/Makefile
@@ -10,5 +10,6 @@
SRCS= main.c check.c boot.c fat.c dir.c fsutil.c
CFLAGS+= -I${FSCK}
+LIBADD= util
.include <bsd.prog.mk>
Index: sbin/fsck_msdosfs/check.c
===================================================================
--- sbin/fsck_msdosfs/check.c
+++ sbin/fsck_msdosfs/check.c
@@ -33,6 +33,7 @@
"$FreeBSD$";
#endif /* not lint */
+#include <libutil.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -51,6 +52,7 @@
int finish_dosdirsection=0;
int mod = 0;
int ret = 8;
+ char freestr[7], badstr[7];
rdonly = alwaysno;
if (!preen)
@@ -126,15 +128,24 @@
mod |= FSERROR;
}
- if (boot.NumBad)
- pwarn("%d files, %d free (%d clusters), %d bad (%d clusters)\n",
+ 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,
- boot.NumFree * boot.ClusterSize / 1024, boot.NumFree,
- boot.NumBad * boot.ClusterSize / 1024, boot.NumBad);
- else
- pwarn("%d files, %d free (%d clusters)\n",
+ freestr, boot.NumFree,
+ badstr, boot.NumBad);
+ } else {
+ pwarn("%d files, %sB free (%d clusters)\n",
boot.NumFiles,
- boot.NumFree * boot.ClusterSize / 1024, boot.NumFree);
+ freestr, boot.NumFree);
+ }
if (mod && (mod & FSERROR) == 0) {
if (mod & FSDIRTY) {

File Metadata

Mime Type
text/plain
Expires
Tue, Sep 29, 5:47 AM (58 m, 59 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39843090
Default Alt Text
D23050.id66402.diff (1 KB)

Event Timeline