aboutsummaryrefslogtreecommitdiff
path: root/sbin/shutdown
diff options
context:
space:
mode:
authorDima Dorfman <dd@FreeBSD.org>2001-07-15 05:46:07 +0000
committerDima Dorfman <dd@FreeBSD.org>2001-07-15 05:46:07 +0000
commit04983c4fe59ed427860e9f48cd25bddf5d8ab822 (patch)
tree591e72c8ed4023f89f7e88ba6ac806415c36a0ef /sbin/shutdown
parent8b032500b6fa353ec303e9de9d91295e315fb155 (diff)
downloadsrc-04983c4fe59ed427860e9f48cd25bddf5d8ab822.tar.gz
src-04983c4fe59ed427860e9f48cd25bddf5d8ab822.zip
Constify, de-register-ify, __unused-ify, and set WARNS=2.
Submitted by: Mike Barcroft <mike@q9media.com>
Notes
Notes: svn path=/head/; revision=79749
Diffstat (limited to 'sbin/shutdown')
-rw-r--r--sbin/shutdown/Makefile1
-rw-r--r--sbin/shutdown/shutdown.c21
2 files changed, 12 insertions, 10 deletions
diff --git a/sbin/shutdown/Makefile b/sbin/shutdown/Makefile
index c758c79f5fca..0a8f848f67ec 100644
--- a/sbin/shutdown/Makefile
+++ b/sbin/shutdown/Makefile
@@ -2,6 +2,7 @@
# $FreeBSD$
PROG= shutdown
+WARNS?= 2
MAN= shutdown.8
BINGRP= operator
BINMODE=4550
diff --git a/sbin/shutdown/shutdown.c b/sbin/shutdown/shutdown.c
index cf40b3d0a045..0fe703fbc892 100644
--- a/sbin/shutdown/shutdown.c
+++ b/sbin/shutdown/shutdown.c
@@ -94,7 +94,8 @@ struct interval {
static time_t offset, shuttime;
static int dohalt, dopower, doreboot, killflg, mbuflen, oflag;
-static char *nosync, *whom, mbuf[BUFSIZ];
+static char mbuf[BUFSIZ];
+static const char *nosync, *whom;
void badtime __P((void));
void die_you_gravy_sucking_pig_dog __P((void));
@@ -111,7 +112,7 @@ main(argc, argv)
int argc;
char *argv[];
{
- register char *p, *endp;
+ char *p, *endp;
struct passwd *pw;
int arglen, ch, len, readstdin;
@@ -247,7 +248,7 @@ loop()
* the next wait time.
*/
if ((sltime = offset - tp->timeleft)) {
- if (sltime > tp->timetowait / 5)
+ if (sltime > (u_int)(tp->timetowait / 5))
timewarn(offset);
(void)sleep(sltime);
}
@@ -267,7 +268,7 @@ loop()
static jmp_buf alarmbuf;
-static char *restricted_environ[] = {
+static const char *restricted_environ[] = {
"PATH=" _PATH_STDPATH,
NULL
};
@@ -280,7 +281,7 @@ timewarn(timeleft)
static char hostname[MAXHOSTNAMELEN + 1];
FILE *pf;
char wcmd[MAXPATHLEN + 4];
- extern char **environ;
+ extern const char **environ;
if (!first++)
(void)gethostname(hostname, sizeof(hostname));
@@ -326,7 +327,7 @@ timewarn(timeleft)
void
timeout(signo)
- int signo;
+ int signo __unused;
{
longjmp(alarmbuf, 1);
}
@@ -394,10 +395,10 @@ die_you_gravy_sucking_pig_dog()
void
getoffset(timearg)
- register char *timearg;
+ char *timearg;
{
- register struct tm *lt;
- register char *p;
+ struct tm *lt;
+ char *p;
time_t now;
int this_year;
@@ -500,7 +501,7 @@ nolog()
void
finish(signo)
- int signo;
+ int signo __unused;
{
if (!killflg)
(void)unlink(_PATH_NOLOGIN);