Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Oct 2016 12:56:28 +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-11@freebsd.org
Subject:   svn commit: r308035 - stable/11/sbin/init
Message-ID:  <201610281256.u9SCuSKC035431@repo.freebsd.org>

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

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

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

Modified: stable/11/sbin/init/init.c
==============================================================================
--- stable/11/sbin/init/init.c	Fri Oct 28 12:55:14 2016	(r308034)
+++ stable/11/sbin/init/init.c	Fri Oct 28 12:56:27 2016	(r308035)
@@ -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();



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