a second va_list in xlog_backend() and then use that va_list
to print messages on stderr.
Signed-off-by: Steinar H. Gunderson <sesse@debian.org>
Signed-off-by: Steve Langasek <vorlon@debian.org>
Signed-off-by: Steve Dickson <steved@dickson.boston.devel.redhat.com>
void
xlog_backend(int kind, const char *fmt, va_list args)
{
+ va_list args2;
+
if (!(kind & (L_ALL)) && !(logging && (kind & logmask)))
return;
+ if (log_stderr)
+ va_copy(args2, args);
+
if (log_syslog) {
switch (kind) {
case L_FATAL:
#else
fprintf(stderr, "%s: ", log_name);
#endif
-
- vfprintf(stderr, fmt, args);
+ vfprintf(stderr, fmt, args2);
fprintf(stderr, "\n");
+ va_end(args2);
}
if (kind == L_FATAL)