summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_msdosfs
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2003-12-27 06:21:44 +0000
committerbde <bde@FreeBSD.org>2003-12-27 06:21:44 +0000
commite5661d9d2c88ddcf7288eba2525d2e64e0cc19d2 (patch)
tree57e0956712caf9ee116722d16174d3deb87bef7e /sbin/fsck_msdosfs
parentb6db680771293b4b1b36cdbd47e0fe40caf5bfc3 (diff)
downloadFreeBSD-src-e5661d9d2c88ddcf7288eba2525d2e64e0cc19d2.zip
FreeBSD-src-e5661d9d2c88ddcf7288eba2525d2e64e0cc19d2.tar.gz
Fixed some style bugs in previous commit (mainly highly non-KNF indentation).
Diffstat (limited to 'sbin/fsck_msdosfs')
-rw-r--r--sbin/fsck_msdosfs/check.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/sbin/fsck_msdosfs/check.c b/sbin/fsck_msdosfs/check.c
index 72e5b0a..149f261 100644
--- a/sbin/fsck_msdosfs/check.c
+++ b/sbin/fsck_msdosfs/check.c
@@ -84,8 +84,9 @@ checkfilesys(const char *fname)
return 8;
}
- if (checkdirty(dosfs, &boot) && !force) {
- if (preen) printf("%s: ", fname);
+ if (checkdirty(dosfs, &boot) && !force) {
+ if (preen)
+ printf("%s: ", fname);
printf("FILESYSTEM CLEAN; SKIPPING CHECKS\n");
ret = 0;
goto out;
@@ -199,18 +200,19 @@ checkfilesys(const char *fname)
return ret;
}
-int checkdirty(int fs, struct bootblock *boot)
+int
+checkdirty(int fs, struct bootblock *boot)
{
off_t off;
u_char *buffer;
int ret = 0;
-
+
if (boot->ClustMask == CLUST12_MASK)
- return 0;
+ return 0;
off = boot->ResSectors;
off *= boot->BytesPerSec;
-
+
buffer = malloc(boot->BytesPerSec);
if (buffer == NULL) {
perror("No space for FAT");
@@ -222,19 +224,17 @@ int checkdirty(int fs, struct bootblock *boot)
goto err;
}
- if (read(fs, buffer, boot->BytesPerSec)
- != boot->BytesPerSec) {
+ if (read(fs, buffer, boot->BytesPerSec) != boot->BytesPerSec) {
perror("Unable to read FAT");
goto err;
}
- if (buffer[0] == boot->Media && buffer[1] == 0xff
- && buffer[2] == 0xff
- && ((boot->ClustMask == CLUST16_MASK && buffer[3] == 0x7f)
- || (boot->ClustMask == CLUST32_MASK
- && buffer[3] == 0x0f && buffer[4] == 0xff
- && buffer[5] == 0xff && buffer[6] == 0xff
- && buffer[7] == 0x07)))
+ if (buffer[0] == boot->Media && buffer[1] == 0xff &&
+ buffer[2] == 0xff &&
+ ((boot->ClustMask == CLUST16_MASK && buffer[3] == 0x7f) ||
+ (boot->ClustMask == CLUST32_MASK && buffer[3] == 0x0f &&
+ buffer[4] == 0xff && buffer[5] == 0xff && buffer[6] == 0xff &&
+ buffer[7] == 0x07)))
ret = 0;
else
ret = 1;
OpenPOWER on IntegriCloud