use getopt; do not check for root filesystem when given a list of devices
[unix-history] / usr / src / sbin / fsck / setup.c
index 824494d..0ebcfcf 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)setup.c    5.25 (Berkeley) %G%";
+static char sccsid[] = "@(#)setup.c    5.27 (Berkeley) %G%";
 #endif /* not lint */
 
 #define DKTYPENAMES
 #endif /* not lint */
 
 #define DKTYPENAMES
@@ -264,7 +264,18 @@ setup(dev)
                    (maxino + 1) * sizeof(short));
                goto badsb;
        }
                    (maxino + 1) * sizeof(short));
                goto badsb;
        }
-
+       numdirs = sblock.fs_cstotal.cs_ndir;
+       inplast = 0;
+       listmax = numdirs + 10;
+       inpsort = (struct inoinfo **)calloc((unsigned)listmax,
+           sizeof(struct inoinfo *));
+       inphead = (struct inoinfo **)calloc((unsigned)numdirs,
+           sizeof(struct inoinfo *));
+       if (inpsort == NULL || inphead == NULL) {
+               printf("cannot alloc %d bytes for inphead\n", 
+                   numdirs * sizeof(struct inoinfo *));
+               goto badsb;
+       }
        bufinit();
        return (1);
 
        bufinit();
        return (1);