From 7f9033632b20aa8b0fd17dca3cbf74a52b6b287e Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Tue, 25 Oct 1994 03:37:12 +0000 Subject: entered into RCS --- ufs-fsck/inode.c | 3 +++ ufs-fsck/setup.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ufs-fsck/inode.c b/ufs-fsck/inode.c index c10906ff..afb8b1a4 100644 --- a/ufs-fsck/inode.c +++ b/ufs-fsck/inode.c @@ -50,6 +50,9 @@ inode_iterate (struct dinode *dp, readblock (fsbtodb (sblock, iblock), ptrs, sblock->fs_bsize); for (i = 0; i < NINDIR (sblock); i++) { + if (!ptrs[i]) + continue; + if (level == 0) { cont = (*fn)(ptrs[i], sblock->fs_frag, totaloffset); diff --git a/ufs-fsck/setup.c b/ufs-fsck/setup.c index a4c65bc0..f3faf07d 100644 --- a/ufs-fsck/setup.c +++ b/ufs-fsck/setup.c @@ -49,9 +49,9 @@ setup (char *dev) } if (preen == 0) printf ("** %s", dev); - if (!nflag) + if (!nowrite) readfd = open (dev, O_RDWR); - if (nflag || readfd == -1) + if (nowrite || readfd == -1) { readfd = open (dev, O_RDONLY); if (readfd == -1) @@ -60,7 +60,7 @@ setup (char *dev) return 0; } writefd = -1; - nflag = 1; + nowrite = 1; if (preen) pfatal ("NO WRITE ACCESS"); printf (" (NO WRITE)"); -- cgit v1.2.3