summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-02-06 16:47:06 +0000
committerimp <imp@FreeBSD.org>2002-02-06 16:47:06 +0000
commit2415390b96e2acb365cf490995d16ba1496273c0 (patch)
tree93be7c2693a68999ca2695ac994c6b4457dce225 /libexec
parent03e95a007574b9643fd72401983d6f3f4a08142e (diff)
downloadFreeBSD-src-2415390b96e2acb365cf490995d16ba1496273c0.zip
FreeBSD-src-2415390b96e2acb365cf490995d16ba1496273c0.tar.gz
Remove some unused variables, mark unused parameters as unused and change
names of variables that shadow globally declared variables. This should help people doing later WARNS= fixes.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/getty/main.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/libexec/getty/main.c b/libexec/getty/main.c
index c72abf9..4d87215 100644
--- a/libexec/getty/main.c
+++ b/libexec/getty/main.c
@@ -150,7 +150,7 @@ static int opentty(const char *, int);
jmp_buf timeout;
static void
-dingdong(int signo)
+dingdong(int signo __unused)
{
alarm(0);
longjmp(timeout, 1);
@@ -159,7 +159,7 @@ dingdong(int signo)
jmp_buf intrupt;
static void
-interrupt(int signo)
+interrupt(int signo __unused)
{
longjmp(intrupt, 1);
}
@@ -168,7 +168,7 @@ interrupt(int signo)
* Action to take when getty is running too long.
*/
static void
-timeoverrun(int signo)
+timeoverrun(int signo __unused)
{
syslog(LOG_ERR, "getty exiting due to excessive running time");
@@ -241,16 +241,16 @@ main(int argc, char *argv[])
if (AC) {
int i, rfds;
- struct timeval timeout;
+ struct timeval to;
if (!opentty(ttyn, O_RDWR|O_NONBLOCK))
exit(1);
setdefttymode(tname);
rfds = 1 << 0; /* FD_SET */
- timeout.tv_sec = RT;
- timeout.tv_usec = 0;
+ to.tv_sec = RT;
+ to.tv_usec = 0;
i = select(32, (fd_set*)&rfds, (fd_set*)NULL,
- (fd_set*)NULL, RT ? &timeout : NULL);
+ (fd_set*)NULL, RT ? &to : NULL);
if (i < 0) {
syslog(LOG_ERR, "select %s: %m", ttyn);
} else if (i == 0) {
@@ -347,7 +347,6 @@ main(int argc, char *argv[])
if (AL) {
const char *p = AL;
char *q = name;
- int n = sizeof name;
while (*p && q < &name[sizeof name - 1]) {
if (isupper(*p))
@@ -418,22 +417,22 @@ main(int argc, char *argv[])
}
static int
-opentty(const char *ttyn, int flags)
+opentty(const char *tty, int flags)
{
int i, j = 0;
int failopenlogged = 0;
- while (j < 10 && (i = open(ttyn, flags)) == -1)
+ while (j < 10 && (i = open(tty, flags)) == -1)
{
if (((j % 10) == 0) && (errno != ENXIO || !failopenlogged)) {
- syslog(LOG_ERR, "open %s: %m", ttyn);
+ syslog(LOG_ERR, "open %s: %m", tty);
failopenlogged = 1;
}
j++;
sleep(60);
}
if (i == -1) {
- syslog(LOG_ERR, "open %s: %m", ttyn);
+ syslog(LOG_ERR, "open %s: %m", tty);
return 0;
}
else {
@@ -444,7 +443,7 @@ opentty(const char *ttyn, int flags)
return 0;
}
if (login_tty(i) < 0) {
- syslog(LOG_ERR, "login_tty %s: %m", ttyn);
+ syslog(LOG_ERR, "login_tty %s: %m", tty);
close(i);
return 0;
}
OpenPOWER on IntegriCloud