diff options
author | Colin Watson <cjwatson@debian.org> | 2005-01-04 13:07:27 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2005-01-04 13:07:27 +0000 |
commit | fd0f611b70a83d80fe8793af785542ee5541b7cd (patch) | |
tree | bededd22bb7eeec52e20083237ab7e4113445a16 /log.c | |
parent | c44fe9a5b9d3db96a7249b04d915f17e4a3a3b04 (diff) | |
parent | ebd2ce335af5861020c79fddb1ae35c03bf036cf (diff) |
Merge 3.9p1 to the trunk.
Diffstat (limited to 'log.c')
-rw-r--r-- | log.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -51,6 +51,9 @@ static char *argv0; | |||
51 | 51 | ||
52 | extern char *__progname; | 52 | extern char *__progname; |
53 | 53 | ||
54 | #define LOG_SYSLOG_VIS (VIS_CSTYLE|VIS_NL|VIS_TAB|VIS_OCTAL) | ||
55 | #define LOG_STDERR_VIS (VIS_SAFE|VIS_OCTAL) | ||
56 | |||
54 | /* textual representation of log-facilities/levels */ | 57 | /* textual representation of log-facilities/levels */ |
55 | 58 | ||
56 | static struct { | 59 | static struct { |
@@ -318,7 +321,8 @@ do_log(LogLevel level, const char *fmt, va_list args) | |||
318 | } else { | 321 | } else { |
319 | vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); | 322 | vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); |
320 | } | 323 | } |
321 | strnvis(fmtbuf, msgbuf, sizeof(fmtbuf), VIS_SAFE|VIS_OCTAL); | 324 | strnvis(fmtbuf, msgbuf, sizeof(fmtbuf), |
325 | log_on_stderr ? LOG_STDERR_VIS : LOG_SYSLOG_VIS); | ||
322 | if (log_on_stderr) { | 326 | if (log_on_stderr) { |
323 | snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf); | 327 | snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf); |
324 | write(STDERR_FILENO, msgbuf, strlen(msgbuf)); | 328 | write(STDERR_FILENO, msgbuf, strlen(msgbuf)); |