do not log() if debuggin to stderr
authormarkus <markus@openbsd.org>
Tue, 28 Mar 2000 20:26:21 +0000 (20:26 +0000)
committermarkus <markus@openbsd.org>
Tue, 28 Mar 2000 20:26:21 +0000 (20:26 +0000)
usr.bin/ssh/log-server.c

index 124d7fe..a914534 100644 (file)
@@ -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();
+       }
 }