Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/telnetd use LOG_ERR for fatal errors, LOG_WARNING fo...



details:   https://anonhg.NetBSD.org/src/rev/f9d01c14fcca
branches:  trunk
changeset: 501987:f9d01c14fcca
user:      lukem <lukem%NetBSD.org@localhost>
date:      Wed Jan 10 02:51:37 2001 +0000

description:
use LOG_ERR for fatal errors, LOG_WARNING for other errors
minor knf
deprecate LOG_ODELAY; it's the default

diffstat:

 libexec/telnetd/sys_term.c |  18 ++++++++++--------
 libexec/telnetd/telnetd.c  |   6 +++---
 libexec/telnetd/utility.c  |   8 ++++----
 3 files changed, 17 insertions(+), 15 deletions(-)

diffs (122 lines):

diff -r f73f2fde9b7a -r f9d01c14fcca libexec/telnetd/sys_term.c
--- a/libexec/telnetd/sys_term.c        Wed Jan 10 02:33:47 2001 +0000
+++ b/libexec/telnetd/sys_term.c        Wed Jan 10 02:51:37 2001 +0000
@@ -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 @@
 
        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 @@
                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 @@
 {
        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 @@
                (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);
diff -r f73f2fde9b7a -r f9d01c14fcca libexec/telnetd/telnetd.c
--- a/libexec/telnetd/telnetd.c Wed Jan 10 02:33:47 2001 +0000
+++ b/libexec/telnetd/telnetd.c Wed Jan 10 02:51:37 2001 +0000
@@ -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 @@
 #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 @@
        }
 #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);
diff -r f73f2fde9b7a -r f9d01c14fcca libexec/telnetd/utility.c
--- a/libexec/telnetd/utility.c Wed Jan 10 02:33:47 2001 +0000
+++ b/libexec/telnetd/utility.c Wed Jan 10 02:51:37 2001 +0000
@@ -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 @@
     }
     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);



Home | Main Index | Thread Index | Old Index