diff options
author | bde <bde@FreeBSD.org> | 2004-02-05 15:47:46 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2004-02-05 15:47:46 +0000 |
commit | 080a321e4a2597143772f3b1b9e7f3d29f0ab072 (patch) | |
tree | 7b8a5ecdcdfe692df4c818fc59dcbeac44d3f272 /sbin | |
parent | 9cf605d618e7c575664f866650356b95ee967870 (diff) | |
download | FreeBSD-src-080a321e4a2597143772f3b1b9e7f3d29f0ab072.zip FreeBSD-src-080a321e4a2597143772f3b1b9e7f3d29f0ab072.tar.gz |
Fixed operation of -f to match its documentation and fsck_ffs. It
has now has no effect except in combination with -p, and plain fsck
checks all file systems instead of skipping clean ones for msdosfs
only.
Renamed the force flag to skipclean and inverted its logic as in
fsck_ffs.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/fsck_msdosfs/check.c | 5 | ||||
-rw-r--r-- | sbin/fsck_msdosfs/ext.h | 2 | ||||
-rw-r--r-- | sbin/fsck_msdosfs/main.c | 6 |
3 files changed, 6 insertions, 7 deletions
diff --git a/sbin/fsck_msdosfs/check.c b/sbin/fsck_msdosfs/check.c index 6a40749..48ae5ca 100644 --- a/sbin/fsck_msdosfs/check.c +++ b/sbin/fsck_msdosfs/check.c @@ -84,9 +84,8 @@ checkfilesys(const char *fname) return 8; } - if (checkdirty(dosfs, &boot) && !force) { - if (preen) - printf("%s: ", fname); + if (skipclean && preen && checkdirty(dosfs, &boot)) { + printf("%s: ", fname); printf("FILESYSTEM CLEAN; SKIPPING CHECKS\n"); ret = 0; goto out; diff --git a/sbin/fsck_msdosfs/ext.h b/sbin/fsck_msdosfs/ext.h index 7a24a5d..0e93c24 100644 --- a/sbin/fsck_msdosfs/ext.h +++ b/sbin/fsck_msdosfs/ext.h @@ -46,9 +46,9 @@ */ extern int alwaysno; /* assume "no" for all questions */ extern int alwaysyes; /* assume "yes" for all questions */ -extern int force; /* force check even the fs is clean */ extern int preen; /* we are preening */ extern int rdonly; /* device is opened read only (supersedes above) */ +extern int skipclean; /* skip clean file systems if preening */ extern struct dosDirEntry *rootDir; diff --git a/sbin/fsck_msdosfs/main.c b/sbin/fsck_msdosfs/main.c index b0e852e..37bfb6e 100644 --- a/sbin/fsck_msdosfs/main.c +++ b/sbin/fsck_msdosfs/main.c @@ -51,9 +51,9 @@ static const char rcsid[] = int alwaysno; /* assume "no" for all questions */ int alwaysyes; /* assume "yes" for all questions */ -int force; /* force check even the fs is clean */ int preen; /* set when preening */ int rdonly; /* device is opened read only (supersedes above) */ +int skipclean; /* skip clean file systems if preening */ static void usage(void) __dead2; @@ -71,11 +71,11 @@ main(int argc, char **argv) int ret = 0, erg; int ch; - force = 0; + skipclean = 1; while ((ch = getopt(argc, argv, "fFnpy")) != -1) { switch (ch) { case 'f': - force = 1; + skipclean = 0; break; case 'F': /* |