aboutsummaryrefslogtreecommitdiff
path: root/sbin/shutdown
diff options
context:
space:
mode:
authorPhilippe Charnier <charnier@FreeBSD.org>1998-08-03 06:22:43 +0000
committerPhilippe Charnier <charnier@FreeBSD.org>1998-08-03 06:22:43 +0000
commitd371486332641a3383cf7b6b7fd90cb87a6297af (patch)
treef7d331296a7428202abdc0e9c41e0c405c9d20fe /sbin/shutdown
parentbd48897bd1bb164792db8ca05cc35e221acfacab (diff)
downloadsrc-d371486332641a3383cf7b6b7fd90cb87a6297af.tar.gz
src-d371486332641a3383cf7b6b7fd90cb87a6297af.zip
Correct use of .Nm. Add rcsid. Do not dot terminate err(3) strings. Spelling.
Notes
Notes: svn path=/head/; revision=38036
Diffstat (limited to 'sbin/shutdown')
-rw-r--r--sbin/shutdown/shutdown.817
-rw-r--r--sbin/shutdown/shutdown.c19
2 files changed, 19 insertions, 17 deletions
diff --git a/sbin/shutdown/shutdown.8 b/sbin/shutdown/shutdown.8
index 00be46538b53..0d40c1cddbcc 100644
--- a/sbin/shutdown/shutdown.8
+++ b/sbin/shutdown/shutdown.8
@@ -30,6 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)shutdown.8 8.1 (Berkeley) 6/5/93
+.\" $Id$
.\"
.Dd June 5, 1993
.Dt SHUTDOWN 8
@@ -50,14 +51,14 @@ to nicely notify users when the system is shutting down,
saving them from system administrators, hackers, and gurus, who
would otherwise not bother with such niceties.
.Pp
-Available friendlinesses:
-.Bl -tag -width time
+The following options are available:
+.Bl -tag -width indent
.It Fl h
The system is halted at the specified
.Ar time
when
-.Nm shutdown
-execs
+.Nm
+executes
.Xr halt 8 .
.It Fl k
Kick every body off.
@@ -72,14 +73,14 @@ Prevent the normal
before stopping.
.It Fl r
.Nm Shutdown
-execs
+executes
.Xr reboot 8
at the specified
.Ar time .
.It Ar time
.Ar Time
is the time at which
-.Nm shutdown
+.Nm
will bring the system down and
may be the word
.Ar now
@@ -114,14 +115,14 @@ log in,
.Xr login 1
prints its contents and exits. The file is
removed just before
-.Nm shutdown
+.Nm
exits.
.Pp
At shutdown time a message is written in the system log, containing the
time of shutdown, who initiated the shutdown and the reason.
A terminate
signal is then sent to
-.Xr init
+.Xr init 8
to bring the system down to single-user state (depending on above
options).
The time of the shutdown and the warning message
diff --git a/sbin/shutdown/shutdown.c b/sbin/shutdown/shutdown.c
index 11911b07ef54..025a1c68b423 100644
--- a/sbin/shutdown/shutdown.c
+++ b/sbin/shutdown/shutdown.c
@@ -29,18 +29,20 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id: shutdown.c,v 1.11 1998/01/08 20:05:45 alex Exp $
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1988, 1990, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
+#if 0
static char sccsid[] = "@(#)shutdown.c 8.2 (Berkeley) 2/16/94";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
@@ -49,6 +51,7 @@ static char sccsid[] = "@(#)shutdown.c 8.2 (Berkeley) 2/16/94";
#include <sys/syslog.h>
#include <ctype.h>
+#include <err.h>
#include <fcntl.h>
#include <pwd.h>
#include <setjmp.h>
@@ -57,7 +60,6 @@ static char sccsid[] = "@(#)shutdown.c 8.2 (Berkeley) 2/16/94";
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <err.h>
#include "pathnames.h"
@@ -109,7 +111,6 @@ main(argc, argv)
int argc;
char *argv[];
{
- extern int optind;
register char *p, *endp;
struct passwd *pw;
int arglen, ch, len, readstdin;
@@ -148,7 +149,7 @@ main(argc, argv)
usage();
if (doreboot && dohalt) {
- warnx("incompatible switches -h and -r.");
+ warnx("incompatible switches -h and -r");
usage();
}
getoffset(*argv++);
@@ -208,7 +209,7 @@ main(argc, argv)
#endif
openlog("shutdown", LOG_CONS, LOG_AUTH);
loop();
- /* NOTREACHED */
+ return(0);
}
void
@@ -301,7 +302,7 @@ timewarn(timeleft)
/*
* play some games, just in case wall doesn't come back
- * probably unecessary, given that wall is careful.
+ * probably unnecessary, given that wall is careful.
*/
if (!setjmp(alarmbuf)) {
(void)signal(SIGALRM, timeout);
@@ -474,7 +475,7 @@ finish(signo)
void
badtime()
{
- errx(1, "bad time format.");
+ errx(1, "bad time format");
}
void