do not dump core when missing `.' or `..' entries in directories
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Thu, 24 Apr 1986 03:04:51 +0000 (19:04 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Thu, 24 Apr 1986 03:04:51 +0000 (19:04 -0800)
SCCS-vsn: sbin/restore/dirs.c 5.4
SCCS-vsn: sbin/restore/main.c 5.3

usr/src/sbin/restore/dirs.c
usr/src/sbin/restore/main.c

index d2b042b..c8c16f7 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)dirs.c     5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)dirs.c     5.4 (Berkeley) %G%";
 #endif not lint
 
 #include "restore.h"
 #endif not lint
 
 #include "restore.h"
@@ -172,22 +172,16 @@ treescan(pname, ino, todo)
        namelen = strlen(locname);
        rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt);
        dp = rst_readdir(dirp); /* "." */
        namelen = strlen(locname);
        rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt);
        dp = rst_readdir(dirp); /* "." */
-       if (dp != NULL && strcmp(dp->d_name, ".") == 0) {
+       if (dp != NULL && strcmp(dp->d_name, ".") == 0)
                dp = rst_readdir(dirp); /* ".." */
                dp = rst_readdir(dirp); /* ".." */
-       } else {
-               np = lookupino(ino);
-               if (np == NULL)
-                       panic("corrupted symbol table\n");
-               fprintf(stderr, ". missing from directory %s\n", myname(np));
-       }
-       if (dp != NULL && strcmp(dp->d_name, "..") == 0) {
+       else
+               fprintf(stderr, "Warning: `.' missing from directory %s\n",
+                       pname);
+       if (dp != NULL && strcmp(dp->d_name, "..") == 0)
                dp = rst_readdir(dirp); /* first real entry */
                dp = rst_readdir(dirp); /* first real entry */
-       } else {
-               np = lookupino(ino);
-               if (np == NULL)
-                       panic("corrupted symbol table\n");
-               fprintf(stderr, ".. missing from directory %s\n", myname(np));
-       }
+       else
+               fprintf(stderr, "Warning: `..' missing from directory %s\n",
+                       pname);
        bpt = telldir(dirp);
        /*
         * a zero inode signals end of directory
        bpt = telldir(dirp);
        /*
         * a zero inode signals end of directory
index 60b33a9..9a90e64 100644 (file)
@@ -11,7 +11,7 @@ char copyright[] =
 #endif not lint
 
 #ifndef lint
 #endif not lint
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     5.3 (Berkeley) %G%";
 #endif not lint
 
 /*
 #endif not lint
 
 /*
@@ -233,6 +233,7 @@ usage:
        case 't':
                setup();
                extractdirs(0);
        case 't':
                setup();
                extractdirs(0);
+               initsymtable((char *)0);
                while (argc--) {
                        canon(*argv++, name);
                        ino = dirlookup(name);
                while (argc--) {
                        canon(*argv++, name);
                        ino = dirlookup(name);