summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_msdosfs
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2004-04-20 11:41:57 +0000
committertjr <tjr@FreeBSD.org>2004-04-20 11:41:57 +0000
commit86f07d4f93e44ea8dabbe4c115e8c8c74c0a9f23 (patch)
treefbca8d6b0adb73961c291aabfdfe5d280b4b80a0 /sbin/fsck_msdosfs
parentaaa4408d553623269b5d091d94f14ad995c8a10d (diff)
downloadFreeBSD-src-86f07d4f93e44ea8dabbe4c115e8c8c74c0a9f23.zip
FreeBSD-src-86f07d4f93e44ea8dabbe4c115e8c8c74c0a9f23.tar.gz
Only compare the interesting part of the bootblock with its backup.
Allow check to proceed with bad backup boot block if we're doing a readonly check. Various typos in comments. Obtained from: NetBSD
Diffstat (limited to 'sbin/fsck_msdosfs')
-rw-r--r--sbin/fsck_msdosfs/boot.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sbin/fsck_msdosfs/boot.c b/sbin/fsck_msdosfs/boot.c
index 0f6a61b..32ed863 100644
--- a/sbin/fsck_msdosfs/boot.c
+++ b/sbin/fsck_msdosfs/boot.c
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: boot.c,v 1.5 1997/10/17 11:19:23 ws Exp $");
+__RCSID("$NetBSD: boot.c,v 1.9 2003/07/24 19:25:46 ws Exp $");
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
@@ -159,10 +159,14 @@ readboot(dosfs, boot)
perror("could not read backup bootblock");
return FSFATAL;
}
- if (memcmp(block, backup, DOSBOOTBLOCKSIZE)) {
+ backup[65] = block[65]; /* XXX */
+ if (memcmp(block + 11, backup + 11, 79)) {
/* Correct? XXX */
pfatal("backup doesn't compare to primary bootblock");
- return FSFATAL;
+ if (alwaysno)
+ pfatal("\n");
+ else
+ return FSFATAL;
}
/* Check backup FSInfo? XXX */
}
@@ -261,7 +265,7 @@ writefsinfo(dosfs, boot)
* correctly, it has to be fixed pretty often.
*
* Therefor, we handle the FSINFO block only informally,
- * fixing it if neccessary, but otherwise ignoring the
+ * fixing it if necessary, but otherwise ignoring the
* fact that it was incorrect.
*/
return 0;
OpenPOWER on IntegriCloud