On common platform, the copy is cheap. In case it isn't we note that the
copy doesn't happen if using a log handler and syslog cannot be enabled
with debug messages.
return;
}
+ /* Log to syslog if requested */
+ if (use_syslog) {
+ va_list ap2;
+ va_copy(ap2, ap);
+ vsyslog(pri, fmt, ap2);
+ va_end(ap2);
}
/* Log to standard error in all cases */
free(nfmt);
}
fflush(stderr);
-
- /* Log to syslog if requested */
- if (use_syslog)
- vsyslog(pri, fmt, ap);
}