As we use flockfile() multiple fprintf() don't create a race-condition.
This also prevents a warning with clang which uses a macro for
fprintf(). #ifdefs within macro arguments is not portable.
(void)line;
#endif
- /* Prevent another thread from interrupting the two printfs(). */
+ /* Prevent another thread from interrupting the printfs(). */
flockfile(stderr);
- fprintf(stderr,
#ifdef DEBUG
- "%-12s:%-3d "
+ fprintf(stderr, "%-12s:%-3d ", file, line);
#endif
- "[%s] [%d] ",
-#ifdef DEBUG
- file, line,
-#endif
- level_string, (int)pthread_self());
+ fprintf(stderr, "[%s] [%d] ", level_string, (int)pthread_self());
va_start(ap, format);
vfprintf(stderr, format, ap);
va_end(ap);