Commit b2965329 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Minor structural change to reduce chance of intermixed output

statements from the two threads.
parent d0c50b3e
......@@ -41,17 +41,18 @@ void
log(const char *fmt, ...)
{
va_list args;
char buf[BUFSIZ];
va_start(args, fmt);
vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
if (!usesyslog) {
vfprintf(stderr, fmt, args);
fputs(buf, stderr);
fputc('\n', stderr);
fflush(stderr);
}
else
vsyslog(LOG_INFO, fmt, args);
va_end(args);
syslog(LOG_INFO, "%s", buf);
}
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment