diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2001-12-03 21:01:52 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2001-12-03 21:01:52 +0000 |
commit | 743061688bbb831a2143568bf26abd82e347f2ab (patch) | |
tree | 66a23f6281626ef58f860d13638232608fa84ef0 | |
parent | 0a2730ac8bd8e6e42e138b32f8389fb0dde38256 (diff) | |
download | FreeBSD-src-743061688bbb831a2143568bf26abd82e347f2ab.zip FreeBSD-src-743061688bbb831a2143568bf26abd82e347f2ab.tar.gz |
Warns cleanups:
Signal handlers are supposed to take an int as an arg.
Don't locally declare crypt or ttyname.
-rw-r--r-- | usr.bin/lock/Makefile | 1 | ||||
-rw-r--r-- | usr.bin/lock/lock.c | 15 |
2 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/lock/Makefile b/usr.bin/lock/Makefile index dc09a87..14b2a14 100644 --- a/usr.bin/lock/Makefile +++ b/usr.bin/lock/Makefile @@ -2,6 +2,7 @@ # $FreeBSD$ PROG= lock +WARNS?= 2 BINOWN= root BINMODE=4555 DPADD= ${LIBCRYPT} diff --git a/usr.bin/lock/lock.c b/usr.bin/lock/lock.c index be3e63f..eeca3ff 100644 --- a/usr.bin/lock/lock.c +++ b/usr.bin/lock/lock.c @@ -73,7 +73,7 @@ static const char rcsid[] = #define TIMEOUT 15 -void quit(), bye(), hi(); +void quit __P((int)), bye __P((int)), hi __P((int)); static void usage __P((void)); struct timeval timeout; @@ -96,7 +96,6 @@ main(argc, argv) int ch, failures, sectimeout, usemine; char *ap, *mypw, *ttynam, *tzn; char hostname[MAXHOSTNAMELEN], s[BUFSIZ], s1[BUFSIZ]; - char *crypt(), *ttyname(); openlog("lock", LOG_ODELAY, LOG_AUTH); @@ -149,7 +148,7 @@ main(argc, argv) /* get key and check again */ (void)printf("Key: "); if (!fgets(s, sizeof(s), stdin) || *s == '\n') - quit(); + quit(0); (void)printf("\nAgain: "); /* * Don't need EOF test here, if we get EOF, then s1 != s @@ -191,7 +190,7 @@ main(argc, argv) (void)printf("Key: "); if (!fgets(s, sizeof(s), stdin)) { clearerr(stdin); - hi(); + hi(0); continue; } if (usemine) { @@ -213,7 +212,7 @@ main(argc, argv) if (getuid() == 0) syslog(LOG_NOTICE, "ROOT UNLOCK ON hostname %s port %s", hostname, ttynam); - quit(); + quit(0); return(0); /* not reached */ } @@ -226,7 +225,7 @@ usage() } void -hi() +hi(int signo __unused) { struct timeval timval; @@ -243,7 +242,7 @@ hi() } void -quit() +quit(int signo __unused) { (void)putchar('\n'); (void)ioctl(0, TIOCSETP, &tty); @@ -251,7 +250,7 @@ quit() } void -bye() +bye(int signo __unused) { if (!no_timeout) { (void)ioctl(0, TIOCSETP, &tty); |