Fix several warnings.
- Add __unused keywords. - Don't shadow a global variable called cr. - Make the global cr variable const.
This commit is contained in:
parent
8ba6b16f90
commit
3e08d559a8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=201379
@ -85,7 +85,7 @@ void onalrm(int);
|
|||||||
void reapchildren(int);
|
void reapchildren(int);
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc __unused, char *argv[] __unused)
|
||||||
{
|
{
|
||||||
struct sockaddr_in from;
|
struct sockaddr_in from;
|
||||||
socklen_t fromlen;
|
socklen_t fromlen;
|
||||||
@ -132,16 +132,16 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
reapchildren(int signo)
|
reapchildren(int signo __unused)
|
||||||
{
|
{
|
||||||
while (wait3(NULL, WNOHANG, NULL) > 0);
|
while (wait3(NULL, WNOHANG, NULL) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
onalrm(int signo)
|
onalrm(int signo __unused)
|
||||||
{
|
{
|
||||||
static u_int utmpsize; /* last malloced size for utmp */
|
static off_t utmpsize; /* last malloced size for utmp */
|
||||||
static u_int utmpmtime; /* last modification time for utmp */
|
static time_t utmpmtime; /* last modification time for utmp */
|
||||||
struct stat statbf;
|
struct stat statbf;
|
||||||
|
|
||||||
if (time(NULL) - lastmsgtime >= MAXIDLE)
|
if (time(NULL) - lastmsgtime >= MAXIDLE)
|
||||||
@ -194,7 +194,7 @@ mailfor(char *name)
|
|||||||
notify(utp, file, offset, folder);
|
notify(utp, file, offset, folder);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *cr;
|
static const char *cr;
|
||||||
|
|
||||||
void
|
void
|
||||||
notify(struct utmp *utp, char file[], off_t offset, int folder)
|
notify(struct utmp *utp, char file[], off_t offset, int folder)
|
||||||
@ -203,11 +203,11 @@ notify(struct utmp *utp, char file[], off_t offset, int folder)
|
|||||||
struct stat stb;
|
struct stat stb;
|
||||||
struct termios tio;
|
struct termios tio;
|
||||||
char tty[20], name[sizeof(utmp[0].ut_name) + 1];
|
char tty[20], name[sizeof(utmp[0].ut_name) + 1];
|
||||||
const char *cr = utp->ut_line;
|
const char *line = utp->ut_line;
|
||||||
|
|
||||||
if (strncmp(cr, "pts/", 4) == 0)
|
if (strncmp(line, "pts/", 4) == 0)
|
||||||
cr += 4;
|
line += 4;
|
||||||
if (strchr(cr, '/')) {
|
if (strchr(line, '/')) {
|
||||||
/* A slash is an attempt to break security... */
|
/* A slash is an attempt to break security... */
|
||||||
syslog(LOG_AUTH | LOG_NOTICE, "Unexpected `/' in `%s'",
|
syslog(LOG_AUTH | LOG_NOTICE, "Unexpected `/' in `%s'",
|
||||||
utp->ut_line);
|
utp->ut_line);
|
||||||
|
Loading…
Reference in New Issue
Block a user