[Midnightbsd-cvs] src [10480] trunk/sbin/shutdown/shutdown.c: sync shutdown

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed Jun 6 20:34:28 EDT 2018


Revision: 10480
          http://svnweb.midnightbsd.org/src/?rev=10480
Author:   laffer1
Date:     2018-06-06 20:34:28 -0400 (Wed, 06 Jun 2018)
Log Message:
-----------
sync shutdown

Modified Paths:
--------------
    trunk/sbin/shutdown/Makefile
    trunk/sbin/shutdown/shutdown.8
    trunk/sbin/shutdown/shutdown.c

Property Changed:
----------------
    trunk/sbin/shutdown/shutdown.8

Modified: trunk/sbin/shutdown/Makefile
===================================================================
--- trunk/sbin/shutdown/Makefile	2018-06-07 00:32:55 UTC (rev 10479)
+++ trunk/sbin/shutdown/Makefile	2018-06-07 00:34:28 UTC (rev 10480)
@@ -1,5 +1,6 @@
+# $MidnightBSD$
 #	@(#)Makefile	8.1 (Berkeley) 6/5/93
-# $MidnightBSD$
+# $FreeBSD: stable/10/sbin/shutdown/Makefile 271075 2014-09-04 01:38:31Z neel $
 
 PROG=	shutdown
 MAN=	shutdown.8
@@ -8,6 +9,6 @@
 
 BINOWN=	root
 BINGRP=	operator
-BINMODE=4550
+BINMODE=4554
 
 .include <bsd.prog.mk>

Modified: trunk/sbin/shutdown/shutdown.8
===================================================================
--- trunk/sbin/shutdown/shutdown.8	2018-06-07 00:32:55 UTC (rev 10479)
+++ trunk/sbin/shutdown/shutdown.8	2018-06-07 00:34:28 UTC (rev 10480)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
 .\" Copyright (c) 1988, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -26,9 +27,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)shutdown.8	8.2 (Berkeley) 4/27/95
-.\" $MidnightBSD$
+.\" $FreeBSD: stable/10/sbin/shutdown/shutdown.8 316204 2017-03-30 02:28:49Z sevan $
 .\"
-.Dd July 13, 2011
+.Dd September 21, 2016
 .Dt SHUTDOWN 8
 .Os
 .Sh NAME
@@ -189,6 +190,11 @@
 .Xr login 1
 not to let anyone log in
 .El
+.Sh EXAMPLES
+Reboot the system in 30 minutes and display a warning message on the terminals
+of all users currently logged in:
+.Pp
+.Dl # shutdown -r +30 \&"System will reboot\&"
 .Sh COMPATIBILITY
 The hours and minutes in the second time format may be separated by
 a colon (``:'') for backward compatibility.
@@ -201,7 +207,9 @@
 .Xr init 8 ,
 .Xr reboot 8
 .Sh HISTORY
-The
+A
 .Nm
-utility appeared in
-.Bx 4.0 .
+command was originally written by Ian Johnstone for UNSW's modified
+.At "6th Edn" .
+It was modified and then incorporated in
+.Bx 4.1 .


Property changes on: trunk/sbin/shutdown/shutdown.8
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sbin/shutdown/shutdown.c
===================================================================
--- trunk/sbin/shutdown/shutdown.c	2018-06-07 00:32:55 UTC (rev 10479)
+++ trunk/sbin/shutdown/shutdown.c	2018-06-07 00:34:28 UTC (rev 10480)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 1988, 1990, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -67,7 +68,7 @@
 #define	M		*60
 #define	S		*1
 #define	NOLOG_TIME	5*60
-struct interval {
+static struct interval {
 	int timeleft, timetowait;
 } tlist[] = {
 	{ 10 H,  5 H },
@@ -93,7 +94,7 @@
 static const char *nosync, *whom;
 
 static void badtime(void);
-static void perform_shutdown(void);
+static void die_you_gravy_sucking_pig_dog(void);
 static void finish(int);
 static void getoffset(char *);
 static void loop(void);
@@ -123,7 +124,7 @@
 	 * Test for the special case where the utility is called as
 	 * "poweroff", for which it runs 'shutdown -p now'.
 	 */
-	if ((p = rindex(argv[0], '/')) == NULL)
+	if ((p = strrchr(argv[0], '/')) == NULL)
 		p = argv[0];
 	else
 		++p;
@@ -282,7 +283,7 @@
 		if (!tp->timeleft)
 			break;
 	}
-	perform_shutdown();
+	die_you_gravy_sucking_pig_dog();
 }
 
 static jmp_buf alarmbuf;
@@ -349,7 +350,7 @@
 }
 
 static void
-perform_shutdown(void)
+die_you_gravy_sucking_pig_dog(void)
 {
 	char *empty_environ[] = { NULL };
 
@@ -356,7 +357,6 @@
 	syslog(LOG_NOTICE, "%s by %s: %s",
 	    doreboot ? "reboot" : dohalt ? "halt" : dopower ? "power-down" : 
 	    "shutdown", whom, mbuf);
-	(void)sleep(2);
 
 	(void)printf("\r\nSystem shutdown time has arrived\007\007\r\n");
 	if (killflg) {



More information about the Midnightbsd-cvs mailing list