diff options
author | kib <kib@FreeBSD.org> | 2016-10-28 12:56:27 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2016-10-28 12:56:27 +0000 |
commit | 02ceddeded0620de7642ea89f01fef8303d55d68 (patch) | |
tree | ecea1194f49fb21529ec9dfa36feaa6852e20a77 /sbin | |
parent | 31d10dcdfc16533a171330ae7b4782c7a5e0efa4 (diff) | |
download | FreeBSD-src-02ceddeded0620de7642ea89f01fef8303d55d68.zip FreeBSD-src-02ceddeded0620de7642ea89f01fef8303d55d68.tar.gz |
MFC r306808:
Add verbosity around failed reboot(2) call.
Diffstat (limited to 'sbin')
-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 24785fe..25ac2bd 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(); |