summaryrefslogtreecommitdiffstats
path: root/sbin/fsck/fsck.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2009-01-30 18:33:05 +0000
committerobrien <obrien@FreeBSD.org>2009-01-30 18:33:05 +0000
commit7d88cc57bfb464896ea2e3fd2b0cffe6d6ea7ecd (patch)
tree65f596e651497e62a137531d7771a73ad6ee6ac8 /sbin/fsck/fsck.c
parentf5f831de53b881b68dd4aa49b41c1ea7c73d4c6a (diff)
downloadFreeBSD-src-7d88cc57bfb464896ea2e3fd2b0cffe6d6ea7ecd.zip
FreeBSD-src-7d88cc57bfb464896ea2e3fd2b0cffe6d6ea7ecd.tar.gz
Add the '-C' "check clean" flag. If the FS is marked clean, skip file
system checking. However, if the file system is not clean, perform a full fsck. Reviewed by: delphij Obtained from: Juniper Networks
Diffstat (limited to 'sbin/fsck/fsck.c')
-rw-r--r--sbin/fsck/fsck.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sbin/fsck/fsck.c b/sbin/fsck/fsck.c
index 490a29a..13eb9f0 100644
--- a/sbin/fsck/fsck.c
+++ b/sbin/fsck/fsck.c
@@ -103,7 +103,7 @@ main(int argc, char *argv[])
TAILQ_INIT(&selhead);
TAILQ_INIT(&opthead);
- while ((i = getopt(argc, argv, "BdvpfFnyl:t:T:")) != -1)
+ while ((i = getopt(argc, argv, "BCdvpfFnyl:t:T:")) != -1)
switch (i) {
case 'B':
if (flags & CHECK_BACKGRD)
@@ -128,6 +128,9 @@ main(int argc, char *argv[])
case 'p':
flags |= CHECK_PREEN;
/*FALLTHROUGH*/
+ case 'C':
+ flags |= CHECK_CLEAN;
+ /*FALLTHROUGH*/
case 'n':
case 'y':
globopt[1] = i;
@@ -566,7 +569,7 @@ static void
usage(void)
{
static const char common[] =
- "[-dfnpvy] [-B | -F] [-T fstype:fsoptions] [-t fstype]";
+ "[-Cdfnpvy] [-B | -F] [-T fstype:fsoptions] [-t fstype]";
(void)fprintf(stderr, "usage: %s %s [special | node] ...\n",
getprogname(), common);
OpenPOWER on IntegriCloud