aboutsummaryrefslogtreecommitdiff
path: root/sbin/fsck_ffs/main.c
diff options
context:
space:
mode:
authorJulian Elischer <julian@FreeBSD.org>1998-03-08 09:59:44 +0000
committerJulian Elischer <julian@FreeBSD.org>1998-03-08 09:59:44 +0000
commitb1897c197c06ebd09ab26a462489bd331c96ce2e (patch)
treeb85bc47a8c7d86c53fcbbd6d7f7c531569f43a1f /sbin/fsck_ffs/main.c
parentfe80c56322a7dd0412230051cb1b7a0a66a74b74 (diff)
downloadsrc-b1897c197c06ebd09ab26a462489bd331c96ce2e.tar.gz
src-b1897c197c06ebd09ab26a462489bd331c96ce2e.zip
Reviewed by: dyson@freebsd.org (john Dyson), dg@root.com (david greenman)
Submitted by: Kirk McKusick (mcKusick@mckusick.com) Obtained from: WHistle development tree
Notes
Notes: svn path=/head/; revision=34266
Diffstat (limited to 'sbin/fsck_ffs/main.c')
-rw-r--r--sbin/fsck_ffs/main.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c
index dcb7006125cb..b4bc2c9caaaf 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);