Add verbosity around failed reboot(2) call.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
This commit is contained in:
Konstantin Belousov 2016-10-07 13:43:38 +00:00
parent 8402d33aa3
commit e10037df2c

View File

@ -885,8 +885,13 @@ single_user(void)
if (Reboot) { if (Reboot) {
/* Instead of going single user, let's reboot the machine */ /* Instead of going single user, let's reboot the machine */
sync(); sync();
reboot(howto); if (reboot(howto) == -1) {
_exit(0); emergency("reboot(%#x) failed, %s", howto,
strerror(errno));
_exit(1); /* panic and reboot */
}
warning("reboot(%#x) returned", howto);
_exit(0); /* panic as well */
} }
shell = get_shell(); shell = get_shell();