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) {
/* Instead of going single user, let's reboot the machine */
sync();
reboot(howto);
_exit(0);
if (reboot(howto) == -1) {
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();