]> Zhao Yanbai Git Server - minix.git/commitdiff
Let halt shutdown system without fsck by checking for halt in wtmp
authorBen Gras <ben@minix3.org>
Thu, 4 Aug 2005 13:41:31 +0000 (13:41 +0000)
committerBen Gras <ben@minix3.org>
Thu, 4 Aug 2005 13:41:31 +0000 (13:41 +0000)
as well as shutdown

commands/reboot/shutdown.c

index 71e5753b16df272076ed40072d612da1783c7c8c..ac1cef8e267f31eedebeedd3dbf75b14fc46a245 100755 (executable)
@@ -402,7 +402,8 @@ int crash_check()
   crashed = (lseek(fd, - (off_t) sizeof(last), SEEK_END) == -1
     || read(fd, (void *) &last, sizeof(last)) != sizeof(last)
     || last.ut_line[0] != '~'
-    || strncmp(last.ut_user, "shutdown", sizeof(last.ut_user)));
+    || (strncmp(last.ut_user, "shutdown", sizeof(last.ut_user))
+     && strncmp(last.ut_user, "halt", sizeof(last.ut_user))));
   close(fd);
   return crashed;
 }