Fix copyright
[unix-history] / usr / src / sbin / fsck / pass1.c
index 80690fe..c7ef655 100644 (file)
@@ -1,6 +1,12 @@
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
 #ifndef lint
 #ifndef lint
-static char version[] = "@(#)pass1.c   3.6 (Berkeley) %G%";
-#endif
+static char sccsid[] = "@(#)pass1.c    5.1 (Berkeley) %G%";
+#endif not lint
 
 #include <sys/param.h>
 #include <sys/inode.h>
 
 #include <sys/param.h>
 #include <sys/inode.h>
@@ -15,6 +21,7 @@ pass1()
 {
        register int c, i, j;
        register DINODE *dp;
 {
        register int c, i, j;
        register DINODE *dp;
+       struct zlncnt *zlnp;
        int ndb, partial, cgd;
        struct inodesc idesc;
        ino_t inumber;
        int ndb, partial, cgd;
        struct inodesc idesc;
        ino_t inumber;
@@ -96,12 +103,15 @@ pass1()
                        n_files++;
                        lncntp[inumber] = dp->di_nlink;
                        if (dp->di_nlink <= 0) {
                        n_files++;
                        lncntp[inumber] = dp->di_nlink;
                        if (dp->di_nlink <= 0) {
-                               if (badlnp < &badlncnt[MAXLNCNT])
-                                       *badlnp++ = inumber;
-                               else {
+                               zlnp = (struct zlncnt *)malloc(sizeof *zlnp);
+                               if (zlnp == NULL) {
                                        pfatal("LINK COUNT TABLE OVERFLOW");
                                        if (reply("CONTINUE") == 0)
                                                errexit("");
                                        pfatal("LINK COUNT TABLE OVERFLOW");
                                        if (reply("CONTINUE") == 0)
                                                errexit("");
+                               } else {
+                                       zlnp->zlncnt = inumber;
+                                       zlnp->next = zlnhead;
+                                       zlnhead = zlnp;
                                }
                        }
                        statemap[inumber] = DIRCT(dp) ? DSTATE : FSTATE;
                                }
                        }
                        statemap[inumber] = DIRCT(dp) ? DSTATE : FSTATE;