svn commit: r324988 - head/sys/kern

Warner Losh imp at FreeBSD.org
Wed Oct 25 15:30:46 UTC 2017


Author: imp
Date: Wed Oct 25 15:30:44 2017
New Revision: 324988
URL: https://svnweb.freebsd.org/changeset/base/324988

Log:
  Handle RB_POWERCYCLE in the MI part of the kernel
  
  Signal init with SIGWINCH in shutdown_nice for RB_POWERCYCLE.
  
  Sponsored by: Netflix

Modified:
  head/sys/kern/kern_shutdown.c

Modified: head/sys/kern/kern_shutdown.c
==============================================================================
--- head/sys/kern/kern_shutdown.c	Wed Oct 25 15:30:40 2017	(r324987)
+++ head/sys/kern/kern_shutdown.c	Wed Oct 25 15:30:44 2017	(r324988)
@@ -283,6 +283,8 @@ shutdown_nice(int howto)
 		PROC_LOCK(initproc);
 		if (howto & RB_POWEROFF)
 			kern_psignal(initproc, SIGUSR2);
+		else if (howto & RB_POWERCYCLE)
+			kern_psignal(initproc, SIGWINCH);
 		else if (howto & RB_HALT)
 			kern_psignal(initproc, SIGUSR1);
 		else
@@ -817,7 +819,7 @@ static void
 poweroff_wait(void *junk, int howto)
 {
 
-	if (!(howto & RB_POWEROFF) || poweroff_delay <= 0)
+	if ((howto & (RB_POWEROFF | RB_POWERCYCLE)) == 0 || poweroff_delay <= 0)
 		return;
 	DELAY(poweroff_delay * 1000);
 }


More information about the svn-src-head mailing list