- (djm) [log.c] Tighten openlog_r tests

This commit is contained in:
Damien Miller 2004-02-18 22:59:43 +11:00
parent 82c78b3b9d
commit 051b0acbbc
2 changed files with 4 additions and 3 deletions

View File

@ -13,6 +13,7 @@
remove cruft left over from RhostsAuthentication removal; remove cruft left over from RhostsAuthentication removal;
ok markus@ ok markus@
- (djm) [log.c] Correct use of HAVE_OPENLOG_R - (djm) [log.c] Correct use of HAVE_OPENLOG_R
- (djm) [log.c] Tighten openlog_r tests
20040217 20040217
- (djm) Simplify the license on code I have written. No code changes. - (djm) Simplify the license on code I have written. No code changes.
@ -1882,4 +1883,4 @@
- Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
Report from murple@murple.net, diagnosis from dtucker@zip.com.au Report from murple@murple.net, diagnosis from dtucker@zip.com.au
$Id: ChangeLog,v 1.3238 2004/02/18 04:42:31 djm Exp $ $Id: ChangeLog,v 1.3239 2004/02/18 11:59:43 djm Exp $

4
log.c
View File

@ -265,7 +265,7 @@ log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr)
void void
do_log(LogLevel level, const char *fmt, va_list args) do_log(LogLevel level, const char *fmt, va_list args)
{ {
#ifdef HAVE_OPENLOG_R #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT)
struct syslog_data sdata = SYSLOG_DATA_INIT; struct syslog_data sdata = SYSLOG_DATA_INIT;
#endif #endif
char msgbuf[MSGBUFSIZ]; char msgbuf[MSGBUFSIZ];
@ -321,7 +321,7 @@ do_log(LogLevel level, const char *fmt, va_list args)
snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf); snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf);
write(STDERR_FILENO, msgbuf, strlen(msgbuf)); write(STDERR_FILENO, msgbuf, strlen(msgbuf));
} else { } else {
#ifdef HAVE_OPENLOG_R #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT)
openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sdata); openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sdata);
syslog_r(pri, &sdata, "%.500s", fmtbuf); syslog_r(pri, &sdata, "%.500s", fmtbuf);
closelog_r(&sdata); closelog_r(&sdata);