From 563e3b7581bf9fe857c88dc0a51f3b454a4ecb57 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Mon, 17 Oct 1994 20:37:08 +0000 Subject: Formerly pass2.c.~8~ --- ufs-fsck/pass2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ufs-fsck/pass2.c b/ufs-fsck/pass2.c index 19d8ba8c..a261ff1d 100644 --- a/ufs-fsck/pass2.c +++ b/ufs-fsck/pass2.c @@ -266,6 +266,7 @@ pass2 () datablocks_iterate (&dino, checkdirblock); } + /* At this point for each directory: If this directory is an entry in another directory, then i_parent is set to that node's number. @@ -277,6 +278,11 @@ pass2 () if (dnp->i_isize == 0) continue; + /* Root is considered to be its own parent even though it isn't + listed. */ + if (dnp->i_number == ROOTINO && !dnp->i_parent) + dnp->i_parent = ROOTINO; + /* Check `..' to make sure it exists and is correct */ if (dnp->i_parent && dnp->i_dotdot == 0) { -- cgit v1.2.3