diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2016-10-07 13:43:38 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2016-10-07 13:43:38 +0000 |
commit | e10037df2c438d4975ff0f24df9b3ad4edc464f0 (patch) | |
tree | 9ab8ce3b6d076c2029051cd1b299b588ee1063ba | |
parent | 8402d33aa38aed7c7ba1e0bbd46636e37ae2716c (diff) | |
download | src-e10037df2c438d4975ff0f24df9b3ad4edc464f0.tar.gz src-e10037df2c438d4975ff0f24df9b3ad4edc464f0.zip |
Add verbosity around failed reboot(2) call.
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks
Notes
Notes:
svn path=/head/; revision=306808
-rw-r--r-- | sbin/init/init.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c index 24785fe827a3..25ac2bd63901 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -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(); |