Commit ef5d9b60 authored by Geoff Simmons's avatar Geoff Simmons

lock log output to file or stdio to prevent overlaps from the two threads

parent d35c7717
......@@ -67,11 +67,13 @@ stdio_log(int level, const char *msg, ...)
if (level > logconf.level)
return;
flockfile(logconf.out);
fprintf(logconf.out, "%s: ", level2name[level]);
va_start(ap, msg);
(void) vfprintf(logconf.out, msg, ap);
va_end(ap);
fprintf(logconf.out, "\n");
funlockfile(logconf.out);
fflush(logconf.out);
}
......
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