diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-02-28 08:36:13 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-02-28 08:36:13 +0000 |
commit | 1e73b9e2b419a4ba9837730df1e3b9306f0174a5 (patch) | |
tree | 240c1fb3edf5a08d67d1f12b66bae120ef4b264d /sbin/fsck_msdos/check.c | |
parent | 705d1d9fe851b2099838aeea8759201df5cf9c2d (diff) |
From NetBSD (ws)
Fix handling of clusters marked bad; Noted by Rafal Boni
Diffstat (limited to 'sbin/fsck_msdos/check.c')
-rw-r--r-- | sbin/fsck_msdos/check.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sbin/fsck_msdos/check.c b/sbin/fsck_msdos/check.c index 8e789062c9e..629e70d8e8b 100644 --- a/sbin/fsck_msdos/check.c +++ b/sbin/fsck_msdos/check.c @@ -1,5 +1,5 @@ -/* $OpenBSD: check.c,v 1.3 1996/06/23 14:30:41 deraadt Exp $ */ -/* $NetBSD: check.c,v 1.1.4.1 1996/05/31 18:41:33 jtc Exp $ */ +/* $OpenBSD: check.c,v 1.4 1997/02/28 08:36:10 millert Exp $ */ +/* $NetBSD: check.c,v 1.6 1997/01/03 14:32:48 ws Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank @@ -35,7 +35,7 @@ #ifndef lint -static char rcsid[] = "$OpenBSD: check.c,v 1.3 1996/06/23 14:30:41 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: check.c,v 1.4 1997/02/28 08:36:10 millert Exp $"; #endif /* not lint */ #include <stdlib.h> @@ -154,9 +154,15 @@ checkfilesys(fname) free(fat); close(dosfs); - pwarn("%d files, %d free (%d clusters)\n", - boot.NumFiles, boot.NumFree * boot.ClusterSize / 1024, - boot.NumFree); + if (boot.NumBad) + pwarn("%d files, %d free (%d clusters), %d 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", + boot.NumFiles, + boot.NumFree * boot.ClusterSize / 1024, boot.NumFree); if (mod & (FSFATAL | FSERROR)) return 8; if (mod) { |