summaryrefslogtreecommitdiff
path: root/ufs-fsck/pass3.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-10-14 02:46:06 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-10-14 02:46:06 +0000
commit6619a1a07ff107e811404f75a6710190456584fd (patch)
tree9b9cab467ccb30cd7de7c029253148672940219f /ufs-fsck/pass3.c
parentdb767a733ad6370063652b47e2169e4453350fc4 (diff)
entered into RCS
Diffstat (limited to 'ufs-fsck/pass3.c')
-rw-r--r--ufs-fsck/pass3.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/ufs-fsck/pass3.c b/ufs-fsck/pass3.c
index 1d366f21..2af148ee 100644
--- a/ufs-fsck/pass3.c
+++ b/ufs-fsck/pass3.c
@@ -18,6 +18,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include "fsck.h"
+
+void
pass3 ()
{
struct dirinfo *dnp;
@@ -26,7 +29,7 @@ pass3 ()
/* Mark all the directories that can be found from the root. */
- statemap[ROOTINO] != DIR_REF;
+ inodestate[ROOTINO] |= DIR_REF;
do
{
@@ -35,8 +38,8 @@ pass3 ()
{
dnp = dirsorted[nd];
if (dnp->i_parent
- && inodestate[dnp->i_parent] == (DIR | DIR_REF)
- && inodestate[dnp->i_number] == DIR)
+ && inodestate[dnp->i_parent] == (DIRECTORY | DIR_REF)
+ && inodestate[dnp->i_number] == DIRECTORY)
{
inodestate[dnp->i_number] |= DIR_REF;
change = 1;
@@ -52,9 +55,10 @@ pass3 ()
if (dnp->i_parent == 0)
{
- assert (!(inodestate[dnp->i_number] & DIR_REF));
+ if (inodestate[dnp->i_number] & DIR_REF)
+ errexit ("ORPHANED DIR MARKED WITH CONNECT");
pwarn ("UNREF DIR");
- pinode (number);
+ pinode (dnp->i_number);
if (preen)
printf (" (RECONNECTED)");
if (preen || reply ("RECONNECT"))