=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/log.c,v retrieving revision 1.24.2.2 retrieving revision 1.25 diff -u -r1.24.2.2 -r1.25 --- src/usr.bin/ssh/log.c 2003/09/16 21:20:26 1.24.2.2 +++ src/usr.bin/ssh/log.c 2003/01/11 18:29:43 1.25 @@ -34,13 +34,12 @@ */ #include "includes.h" -RCSID("$OpenBSD: log.c,v 1.24.2.2 2003/09/16 21:20:26 brad Exp $"); +RCSID("$OpenBSD: log.c,v 1.25 2003/01/11 18:29:43 markus Exp $"); #include "log.h" #include "xmalloc.h" #include -#include static LogLevel log_level = SYSLOG_LEVEL_INFO; static int log_on_stderr = 1; @@ -125,7 +124,7 @@ /* Log this message (information that usually should go to the log). */ void -logit(const char *fmt,...) +log(const char *fmt,...) { va_list args; @@ -332,7 +331,6 @@ void do_log(LogLevel level, const char *fmt, va_list args) { - struct syslog_data sdata = SYSLOG_DATA_INIT; char msgbuf[MSGBUFSIZ]; char fmtbuf[MSGBUFSIZ]; char *txt = NULL; @@ -381,13 +379,11 @@ } else { vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); } - strnvis(fmtbuf, msgbuf, sizeof(fmtbuf), VIS_SAFE|VIS_OCTAL); if (log_on_stderr) { - snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf); - write(STDERR_FILENO, msgbuf, strlen(msgbuf)); + fprintf(stderr, "%s\r\n", msgbuf); } else { - openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sdata); - syslog_r(pri, &sdata, "%.500s", fmtbuf); - closelog_r(&sdata); + openlog(argv0 ? argv0 : __progname, LOG_PID, log_facility); + syslog(pri, "%.500s", msgbuf); + closelog(); } }