always have to initialize d_type
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Mon, 13 Jul 1992 09:22:47 +0000 (01:22 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Mon, 13 Jul 1992 09:22:47 +0000 (01:22 -0800)
SCCS-vsn: sbin/fsck/dir.c 5.23
SCCS-vsn: sbin/fsck/pass2.c 5.21

usr/src/sbin/fsck/dir.c
usr/src/sbin/fsck/pass2.c

index 3943f4b..3705c26 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)dir.c      5.22 (Berkeley) %G%";
+static char sccsid[] = "@(#)dir.c      5.23 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -304,6 +304,8 @@ mkentry(idesc)
        dirp->d_ino = idesc->id_parent; /* ino to be entered is in id_parent */
        if (newinofmt)
                dirp->d_type = typemap[idesc->id_parent];
        dirp->d_ino = idesc->id_parent; /* ino to be entered is in id_parent */
        if (newinofmt)
                dirp->d_type = typemap[idesc->id_parent];
+       else
+               dirp->d_type = 0;
        dirp->d_reclen = newent.d_reclen;
        dirp->d_namlen = newent.d_namlen;
        bcopy(idesc->id_name, dirp->d_name, (size_t)dirp->d_namlen + 1);
        dirp->d_reclen = newent.d_reclen;
        dirp->d_namlen = newent.d_namlen;
        bcopy(idesc->id_name, dirp->d_name, (size_t)dirp->d_namlen + 1);
@@ -320,6 +322,8 @@ chgino(idesc)
        dirp->d_ino = idesc->id_parent;
        if (newinofmt)
                dirp->d_type = typemap[idesc->id_parent];
        dirp->d_ino = idesc->id_parent;
        if (newinofmt)
                dirp->d_type = typemap[idesc->id_parent];
+       else
+               dirp->d_type = 0;
        return (ALTERED|STOP);
 }
 
        return (ALTERED|STOP);
 }
 
index 71d37af..b198cc1 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)pass2.c    5.20 (Berkeley) %G%";
+static char sccsid[] = "@(#)pass2.c    5.21 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -205,6 +205,8 @@ pass2check(idesc)
        proto.d_ino = idesc->id_number;
        if (newinofmt)
                proto.d_type = DT_DIR;
        proto.d_ino = idesc->id_number;
        if (newinofmt)
                proto.d_type = DT_DIR;
+       else
+               proto.d_type = 0;
        proto.d_namlen = 1;
        (void)strcpy(proto.d_name, ".");
        entrysize = DIRSIZ(0, &proto);
        proto.d_namlen = 1;
        (void)strcpy(proto.d_name, ".");
        entrysize = DIRSIZ(0, &proto);
@@ -237,6 +239,8 @@ chk1:
        proto.d_ino = inp->i_parent;
        if (newinofmt)
                proto.d_type = DT_DIR;
        proto.d_ino = inp->i_parent;
        if (newinofmt)
                proto.d_type = DT_DIR;
+       else
+               proto.d_type = 0;
        proto.d_namlen = 2;
        (void)strcpy(proto.d_name, "..");
        entrysize = DIRSIZ(0, &proto);
        proto.d_namlen = 2;
        (void)strcpy(proto.d_name, "..");
        entrysize = DIRSIZ(0, &proto);