Let halt shutdown system without fsck by checking for halt in wtmp

as well as shutdown
This commit is contained in:
Ben Gras 2005-08-04 13:41:31 +00:00
parent 20b4f17334
commit f784f76891

View file

@ -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;
}