From 269b21275be5a4f8df9081e89d482b122f950a8a Mon Sep 17 00:00:00 2001 From: kib Date: Fri, 28 Oct 2016 12:59:21 +0000 Subject: [PATCH] MFC r306808: Add verbosity around failed reboot(2) call. git-svn-id: svn://svn.freebsd.org/base/stable/10@308037 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sbin/init/init.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sbin/init/init.c b/sbin/init/init.c index ba113c83a..7c571d583 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(); -- 2.45.0