Let halt shutdown system without fsck by checking for halt in wtmp
as well as shutdown
This commit is contained in:
parent
20b4f17334
commit
f784f76891
@ -402,7 +402,8 @@ int crash_check()
|
|||||||
crashed = (lseek(fd, - (off_t) sizeof(last), SEEK_END) == -1
|
crashed = (lseek(fd, - (off_t) sizeof(last), SEEK_END) == -1
|
||||||
|| read(fd, (void *) &last, sizeof(last)) != sizeof(last)
|
|| read(fd, (void *) &last, sizeof(last)) != sizeof(last)
|
||||||
|| last.ut_line[0] != '~'
|
|| 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);
|
close(fd);
|
||||||
return crashed;
|
return crashed;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user