use LOG_ERR for fatal errors, LOG_WARNING for other errors

minor knf
deprecate LOG_ODELAY; it's the default
This commit is contained in:
lukem 2001-01-10 02:51:37 +00:00
parent 07ca2a03bf
commit 412ee5c5f1
3 changed files with 17 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: sys_term.c,v 1.20 2000/12/09 00:50:21 assar Exp $ */
/* $NetBSD: sys_term.c,v 1.21 2001/01/10 02:51:37 lukem Exp $ */
/*
* Copyright (c) 1989, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)sys_term.c 8.4+1 (Berkeley) 5/30/95";
#else
__RCSID("$NetBSD: sys_term.c,v 1.20 2000/12/09 00:50:21 assar Exp $");
__RCSID("$NetBSD: sys_term.c,v 1.21 2001/01/10 02:51:37 lukem Exp $");
#endif
#endif /* not lint */
@ -2168,7 +2168,8 @@ cleantmp(wtp)
utp = getutid(wtp);
if (utp == 0) {
syslog(LOG_ERR, "Can't get /etc/utmp entry to clean TMPDIR");
syslog(LOG_WARNING,
"Can't get /etc/utmp entry to clean TMPDIR");
return(-1);
}
/*
@ -2234,7 +2235,8 @@ jobend(jid, path, user)
utp = jid_getutid(pty_saved_jid);
if (utp == 0) {
syslog(LOG_ERR, "Can't get /etc/utmp entry to clean TMPDIR");
syslog(LOG_WARNING,
"Can't get /etc/utmp entry to clean TMPDIR");
return(-1);
}
@ -2256,13 +2258,13 @@ cleantmpdir(jid, tpath, user)
{
switch(fork()) {
case -1:
syslog(LOG_ERR, "TMPDIR cleanup(%s): fork() failed: %m\n",
tpath);
syslog(LOG_WARNING, "TMPDIR cleanup(%s): fork() failed: %m\n",
tpath);
break;
case 0:
execl(CLEANTMPCMD, CLEANTMPCMD, user, tpath, 0);
syslog(LOG_ERR, "TMPDIR cleanup(%s): execl(%s) failed: %m\n",
tpath, CLEANTMPCMD);
tpath, CLEANTMPCMD);
exit(1);
default:
/*
@ -2327,7 +2329,7 @@ rmut()
(void) fstat(f, &statbf);
utmp = (struct utmp *)malloc((unsigned)statbf.st_size);
if (!utmp)
syslog(LOG_ERR, "utmp malloc failed");
syslog(LOG_WARNING, "utmp malloc failed");
if (statbf.st_size && utmp) {
nutmp = read(f, (char *)utmp, (int)statbf.st_size);
nutmp /= sizeof(struct utmp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: telnetd.c,v 1.23 2000/11/19 20:17:39 christos Exp $ */
/* $NetBSD: telnetd.c,v 1.24 2001/01/10 02:51:37 lukem Exp $ */
/*
* Copyright (C) 1997 and 1998 WIDE Project.
@ -69,7 +69,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
#if 0
static char sccsid[] = "@(#)telnetd.c 8.4 (Berkeley) 5/30/95";
#else
__RCSID("$NetBSD: telnetd.c,v 1.23 2000/11/19 20:17:39 christos Exp $");
__RCSID("$NetBSD: telnetd.c,v 1.24 2001/01/10 02:51:37 lukem Exp $");
#endif
#endif /* not lint */
@ -601,7 +601,7 @@ main(argc, argv)
}
#endif /* _SC_CRAY_SECURE_SYS */
openlog("telnetd", LOG_PID | LOG_ODELAY, LOG_DAEMON);
openlog("telnetd", LOG_PID, LOG_DAEMON);
fromlen = sizeof (from);
if (getpeername(0, (struct sockaddr *)&from, &fromlen) < 0) {
fprintf(stderr, "%s: ", progname);

View File

@ -1,4 +1,4 @@
/* $NetBSD: utility.c,v 1.15 2000/10/10 19:54:39 is Exp $ */
/* $NetBSD: utility.c,v 1.16 2001/01/10 02:51:37 lukem Exp $ */
/*
* Copyright (c) 1989, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)utility.c 8.4 (Berkeley) 5/30/95";
#else
__RCSID("$NetBSD: utility.c,v 1.15 2000/10/10 19:54:39 is Exp $");
__RCSID("$NetBSD: utility.c,v 1.16 2001/01/10 02:51:37 lukem Exp $");
#endif
#endif /* not lint */
@ -83,10 +83,10 @@ ttloop()
}
ncc = read(net, netibuf, sizeof netibuf);
if (ncc < 0) {
syslog(LOG_INFO, "ttloop: read: %m");
syslog(LOG_ERR, "ttloop: read: %m");
exit(1);
} else if (ncc == 0) {
syslog(LOG_INFO, "ttloop: peer died: %m");
syslog(LOG_ERR, "ttloop: peer died: %m");
exit(1);
}
DIAG(TD_REPORT, {sprintf(nfrontp, "td: ttloop read %d chars\r\n", ncc);