summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2000-03-28 20:26:22 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2000-03-28 20:26:22 +0000
commit9dc2d82ed4c2f47de7fba2fedaea52353f21431a (patch)
tree4e38df6d073ba977e50e8816ccdde386332cf615
parentce217f8d961baef8ff6b7d77f1e2eab7423c9dc3 (diff)
do not log() if debuggin to stderr
-rw-r--r--usr.bin/ssh/log-server.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/ssh/log-server.c b/usr.bin/ssh/log-server.c
index 124d7fe6b69..a9145347474 100644
--- a/usr.bin/ssh/log-server.c
+++ b/usr.bin/ssh/log-server.c
@@ -15,7 +15,7 @@
*/
#include "includes.h"
-RCSID("$Id: log-server.c,v 1.12 2000/02/27 18:50:09 deraadt Exp $");
+RCSID("$Id: log-server.c,v 1.13 2000/03/28 20:26:21 markus Exp $");
#include <syslog.h>
#include "packet.h"
@@ -132,9 +132,11 @@ do_log(LogLevel level, const char *fmt, va_list args)
} else {
vsnprintf(msgbuf, sizeof(msgbuf), fmt, args);
}
- if (log_on_stderr)
+ if (log_on_stderr) {
fprintf(stderr, "%s\n", msgbuf);
- openlog(__progname, LOG_PID, log_facility);
- syslog(pri, "%.500s", msgbuf);
- closelog();
+ } else {
+ openlog(__progname, LOG_PID, log_facility);
+ syslog(pri, "%.500s", msgbuf);
+ closelog();
+ }
}