must check block root device to insure consistency
authorBill Joy <root@ucbvax.Berkeley.EDU>
Sun, 3 Jul 1983 14:50:07 +0000 (06:50 -0800)
committerBill Joy <root@ucbvax.Berkeley.EDU>
Sun, 3 Jul 1983 14:50:07 +0000 (06:50 -0800)
SCCS-vsn: sbin/fsck/main.c 2.25

usr/src/sbin/fsck/main.c

index 362b148..f99ac59 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-char version[] = "@(#)main.c   2.24 (Berkeley) %G%";
+char version[] = "@(#)main.c   2.25 (Berkeley) %G%";
 #endif
 
 #include <stdio.h>
 #endif
 
 #include <stdio.h>
@@ -7,7 +7,7 @@ char version[] = "@(#)main.c    2.24 (Berkeley) %G%";
 #include <sys/param.h>
 #include <sys/fs.h>
 #include <sys/inode.h>
 #include <sys/param.h>
 #include <sys/fs.h>
 #include <sys/inode.h>
-#include <dir.h>
+#include <sys/dir.h>
 #include <sys/stat.h>
 #include <fstab.h>
 
 #include <sys/stat.h>
 #include <fstab.h>
 
@@ -295,7 +295,7 @@ retry:
                if (stchar.st_mode & S_IFCHR) {
                        if (stslash.st_dev == stblock.st_rdev) {
                                hotroot++;
                if (stchar.st_mode & S_IFCHR) {
                        if (stslash.st_dev == stblock.st_rdev) {
                                hotroot++;
-                               raw = rawname(name);
+                               raw = unrawname(name);
                        }
                        checkfilesys(raw);
                        return (1);
                        }
                        checkfilesys(raw);
                        return (1);
@@ -389,19 +389,17 @@ checkfilesys(filesys)
        free(freemap);
        free(statemap);
        free(lncntp);
        free(freemap);
        free(statemap);
        free(lncntp);
-       if (dfile.mod) {
-               if (preen) {
-                       if (hotroot)
-                               exit(4);
-               } else {
-                       printf("\n***** FILE SYSTEM WAS MODIFIED *****\n");
-                       if (hotroot) {
-                               printf("\n***** BOOT UNIX (NO SYNC!) *****\n");
-                               exit(4);
-                       }
-               }
+       if (!dfile.mod)
+               return;
+       if (!preen) {
+               printf("\n***** FILE SYSTEM WAS MODIFIED *****\n");
+               if (hotroot)
+                       printf("\n***** REBOOT UNIX *****\n");
+       }
+       if (hotroot) {
+               sync();
+               exit(4);
        }
        }
-       sync();                 /* ??? */
 }
 
 setup(dev)
 }
 
 setup(dev)