diff options
author | kib <kib@FreeBSD.org> | 2016-10-28 12:59:21 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2016-10-28 12:59:21 +0000 |
commit | b1c549b19af3542fa2035cca892fc06a94f7ba73 (patch) | |
tree | 861340ebab7dab9a115b1b70f15f9410c47de1e0 /sbin | |
parent | d9adf64f1cc8a399091b95116269fd70f6d5992c (diff) | |
download | FreeBSD-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.c | 9 |
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(); |