Use NULL as gettimeofday arg instead of 0 cast

Add missing arg to error diagnostic
Print yet one arg of error diagnostic
This commit is contained in:
Andrey A. Chernov 1998-07-23 20:05:02 +00:00
parent a623ec03f3
commit 19ce94466c

View File

@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)from: inetd.c 8.4 (Berkeley) 4/13/94"; static char sccsid[] = "@(#)from: inetd.c 8.4 (Berkeley) 4/13/94";
#endif #endif
static const char rcsid[] = static const char rcsid[] =
"$Id: inetd.c,v 1.35 1998/07/22 05:53:53 phk Exp $"; "$Id: inetd.c,v 1.36 1998/07/22 14:24:12 phk Exp $";
#endif /* not lint */ #endif /* not lint */
/* /*
@ -492,12 +492,11 @@ main(argc, argv, envp)
dofork = (sep->se_bi == 0 || sep->se_bi->bi_fork); dofork = (sep->se_bi == 0 || sep->se_bi->bi_fork);
if (dofork) { if (dofork) {
if (sep->se_count++ == 0) if (sep->se_count++ == 0)
(void)gettimeofday(&sep->se_time, (void)gettimeofday(&sep->se_time, NULL);
(struct timezone *)0);
else if (sep->se_count >= toomany) { else if (sep->se_count >= toomany) {
struct timeval now; struct timeval now;
(void)gettimeofday(&now, (struct timezone *)0); (void)gettimeofday(&now, NULL);
if (now.tv_sec - sep->se_time.tv_sec > if (now.tv_sec - sep->se_time.tv_sec >
CNT_INTVL) { CNT_INTVL) {
sep->se_time = now; sep->se_time = now;
@ -587,7 +586,8 @@ main(argc, argv, envp)
/* error syslogged by getclass */ /* error syslogged by getclass */
syslog(LOG_ERR, syslog(LOG_ERR,
"%s/%s: %s: login class error", "%s/%s: %s: login class error",
sep->se_service, sep->se_proto); sep->se_service, sep->se_proto,
sep->se_class);
if (sep->se_socktype != SOCK_STREAM) if (sep->se_socktype != SOCK_STREAM)
recv(0, buf, sizeof (buf), 0); recv(0, buf, sizeof (buf), 0);
_exit(EX_NOUSER); _exit(EX_NOUSER);
@ -735,8 +735,8 @@ config(signo)
if (login_getclass(new->se_class) == NULL) { if (login_getclass(new->se_class) == NULL) {
/* error syslogged by getclass */ /* error syslogged by getclass */
syslog(LOG_ERR, syslog(LOG_ERR,
"%s/%s: login class error, service ignored", "%s/%s: %s: login class error, service ignored",
new->se_service, new->se_proto); new->se_service, new->se_proto, new->se_class);
continue; continue;
} }
#endif #endif
@ -1641,7 +1641,7 @@ machtime()
{ {
struct timeval tv; struct timeval tv;
if (gettimeofday(&tv, (struct timezone *)0) < 0) { if (gettimeofday(&tv, NULL) < 0) {
if (debug) if (debug)
warnx("unable to get time of day"); warnx("unable to get time of day");
return (0L); return (0L);