Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Oct 2016 12:59:21 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r308037 - stable/10/sbin/init
Message-ID:  <201610281259.u9SCxLQm035643@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Oct 28 12:59:21 2016
New Revision: 308037
URL: https://svnweb.freebsd.org/changeset/base/308037

Log:
  MFC r306808:
  Add verbosity around failed reboot(2) call.

Modified:
  stable/10/sbin/init/init.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/init/init.c
==============================================================================
--- stable/10/sbin/init/init.c	Fri Oct 28 12:58:40 2016	(r308036)
+++ stable/10/sbin/init/init.c	Fri Oct 28 12:59:21 2016	(r308037)
@@ -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();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610281259.u9SCxLQm035643>