Constify, de-register-ify, __unused-ify, and set WARNS=2.

Submitted by:	Mike Barcroft <mike@q9media.com>
This commit is contained in:
Dima Dorfman 2001-07-15 05:46:07 +00:00
parent 8b032500b6
commit 04983c4fe5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=79749
2 changed files with 12 additions and 10 deletions

View File

@ -2,6 +2,7 @@
# $FreeBSD$ # $FreeBSD$
PROG= shutdown PROG= shutdown
WARNS?= 2
MAN= shutdown.8 MAN= shutdown.8
BINGRP= operator BINGRP= operator
BINMODE=4550 BINMODE=4550

View File

@ -94,7 +94,8 @@ struct interval {
static time_t offset, shuttime; static time_t offset, shuttime;
static int dohalt, dopower, doreboot, killflg, mbuflen, oflag; 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 badtime __P((void));
void die_you_gravy_sucking_pig_dog __P((void)); void die_you_gravy_sucking_pig_dog __P((void));
@ -111,7 +112,7 @@ main(argc, argv)
int argc; int argc;
char *argv[]; char *argv[];
{ {
register char *p, *endp; char *p, *endp;
struct passwd *pw; struct passwd *pw;
int arglen, ch, len, readstdin; int arglen, ch, len, readstdin;
@ -247,7 +248,7 @@ loop()
* the next wait time. * the next wait time.
*/ */
if ((sltime = offset - tp->timeleft)) { if ((sltime = offset - tp->timeleft)) {
if (sltime > tp->timetowait / 5) if (sltime > (u_int)(tp->timetowait / 5))
timewarn(offset); timewarn(offset);
(void)sleep(sltime); (void)sleep(sltime);
} }
@ -267,7 +268,7 @@ loop()
static jmp_buf alarmbuf; static jmp_buf alarmbuf;
static char *restricted_environ[] = { static const char *restricted_environ[] = {
"PATH=" _PATH_STDPATH, "PATH=" _PATH_STDPATH,
NULL NULL
}; };
@ -280,7 +281,7 @@ timewarn(timeleft)
static char hostname[MAXHOSTNAMELEN + 1]; static char hostname[MAXHOSTNAMELEN + 1];
FILE *pf; FILE *pf;
char wcmd[MAXPATHLEN + 4]; char wcmd[MAXPATHLEN + 4];
extern char **environ; extern const char **environ;
if (!first++) if (!first++)
(void)gethostname(hostname, sizeof(hostname)); (void)gethostname(hostname, sizeof(hostname));
@ -326,7 +327,7 @@ timewarn(timeleft)
void void
timeout(signo) timeout(signo)
int signo; int signo __unused;
{ {
longjmp(alarmbuf, 1); longjmp(alarmbuf, 1);
} }
@ -394,10 +395,10 @@ die_you_gravy_sucking_pig_dog()
void void
getoffset(timearg) getoffset(timearg)
register char *timearg; char *timearg;
{ {
register struct tm *lt; struct tm *lt;
register char *p; char *p;
time_t now; time_t now;
int this_year; int this_year;
@ -500,7 +501,7 @@ nolog()
void void
finish(signo) finish(signo)
int signo; int signo __unused;
{ {
if (!killflg) if (!killflg)
(void)unlink(_PATH_NOLOGIN); (void)unlink(_PATH_NOLOGIN);