summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2016-10-28 12:59:21 +0000
committerkib <kib@FreeBSD.org>2016-10-28 12:59:21 +0000
commitb1c549b19af3542fa2035cca892fc06a94f7ba73 (patch)
tree861340ebab7dab9a115b1b70f15f9410c47de1e0 /sbin
parentd9adf64f1cc8a399091b95116269fd70f6d5992c (diff)
downloadFreeBSD-src-b1c549b19af3542fa2035cca892fc06a94f7ba73.zip
FreeBSD-src-b1c549b19af3542fa2035cca892fc06a94f7ba73.tar.gz
MFC r306808:
Add verbosity around failed reboot(2) call.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/init/init.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c
index ba113c8..7c571d5 100644
--- a/sbin/init/init.c
+++ b/sbin/init/init.c
@@ -891,8 +891,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();
OpenPOWER on IntegriCloud