summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/util/debug.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/util/debug.c b/src/util/debug.c
index 9cd0f41ff..1db3693a1 100644
--- a/src/util/debug.c
+++ b/src/util/debug.c
@@ -203,6 +203,7 @@ void debug_fn(const char *file,
const char *format, ...)
{
va_list ap;
+ va_list ap_fallback;
struct timeval tv;
struct tm *tm;
char datetime[20];
@@ -220,13 +221,15 @@ void debug_fn(const char *file,
* searchable.
*/
va_start(ap, format);
+ va_copy(ap_fallback, ap);
ret = journal_send(file, line, function, level, format, ap);
+ va_end(ap);
if (ret != EOK) {
/* Emergency fallback, send to STDERR */
- debug_vprintf(format, ap);
+ debug_vprintf(format, ap_fallback);
debug_fflush();
}
- va_end(ap);
+ va_end(ap_fallback);
return;
}
#endif