summaryrefslogtreecommitdiff
path: root/usr.bin/lock
diff options
context:
space:
mode:
authorDavid Malone <dwmalone@FreeBSD.org>2001-12-03 21:01:52 +0000
committerDavid Malone <dwmalone@FreeBSD.org>2001-12-03 21:01:52 +0000
commit4285ad09c94f9a9e5e7219d90098af7218f7ea51 (patch)
tree66a23f6281626ef58f860d13638232608fa84ef0 /usr.bin/lock
parent7f6475cec1026f66dc6cebc61670e9985b532c67 (diff)
downloadsrc-test2-4285ad09c94f9a9e5e7219d90098af7218f7ea51.tar.gz
src-test2-4285ad09c94f9a9e5e7219d90098af7218f7ea51.zip
Warns cleanups:
Signal handlers are supposed to take an int as an arg. Don't locally declare crypt or ttyname.
Notes
Notes: svn path=/head/; revision=87286
Diffstat (limited to 'usr.bin/lock')
-rw-r--r--usr.bin/lock/Makefile1
-rw-r--r--usr.bin/lock/lock.c15
2 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/lock/Makefile b/usr.bin/lock/Makefile
index dc09a87b1b9c..14b2a14538dd 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 be3e63fc4232..eeca3ff76247 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);