diff options
author | julian <julian@FreeBSD.org> | 1998-03-08 09:59:44 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1998-03-08 09:59:44 +0000 |
commit | 10c5ccc30ae8155c4d8bd25aeffd9ed0e476c387 (patch) | |
tree | d2ed60b6b9462fe6eebf4796c39dfcf3cec39874 /sbin/fsck_ffs/main.c | |
parent | 1d108bde84c6b5fa5d119363c4f401cc3dcc8110 (diff) | |
download | FreeBSD-src-10c5ccc30ae8155c4d8bd25aeffd9ed0e476c387.zip FreeBSD-src-10c5ccc30ae8155c4d8bd25aeffd9ed0e476c387.tar.gz |
Reviewed by: dyson@freebsd.org (john Dyson), dg@root.com (david greenman)
Submitted by: Kirk McKusick (mcKusick@mckusick.com)
Obtained from: WHistle development tree
Diffstat (limited to 'sbin/fsck_ffs/main.c')
-rw-r--r-- | sbin/fsck_ffs/main.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c index dcb7006..b4bc2c9 100644 --- a/sbin/fsck_ffs/main.c +++ b/sbin/fsck_ffs/main.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/14/95"; #endif static const char rcsid[] = - "$Id$"; + "$Id: main.c,v 1.12 1997/12/20 22:24:32 bde Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -210,6 +210,11 @@ checkfilesys(filesys, mntpt, auxdata, child) } /* + * Cleared if any questions answered no. Used to decide if + * the superblock should be marked clean. + */ + resolved = 1; + /* * 1: scan inodes tallying blocks used */ if (preen == 0) { @@ -224,7 +229,7 @@ checkfilesys(filesys, mntpt, auxdata, child) * 1b: locate first references to duplicates, if any */ if (duplist) { - if (preen) + if (preen || usedsoftdep) pfatal("INTERNAL ERROR: dups with -p"); printf("** Phase 1b - Rescan For More DUPS\n"); pass1b(); @@ -306,19 +311,20 @@ checkfilesys(filesys, mntpt, auxdata, child) bwrite(fswritefd, (char *)&sblock, fsbtodb(&sblock, cgsblock(&sblock, cylno)), SBSIZE); } - if (!hotroot) { - ckfini(1); - } else { + if (rerun) + resolved = 0; + flags = 0; + if (hotroot) { struct statfs stfs_buf; /* * Check to see if root is mounted read-write. */ if (statfs("/", &stfs_buf) == 0) flags = stfs_buf.f_flags; - else - flags = 0; - ckfini(flags & MNT_RDONLY); + if ((flags & MNT_RDONLY) == 0) + resolved = 0; } + ckfini(resolved); free(blockmap); free(statemap); free((char *)lncntp); |