changeset 9370:5f9782109fcf HEAD

master: Startup errors crashed on some systems.
author Timo Sirainen <tss@iki.fi>
date Mon, 07 Sep 2009 11:46:51 -0400
parents cc0d7c00c6ce
children 8fd1ee439437
files src/master/main.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/master/main.c	Mon Sep 07 11:44:38 2009 -0400
+++ b/src/master/main.c	Mon Sep 07 11:46:51 2009 -0400
@@ -143,8 +143,10 @@
 tee_fatal_handler(enum log_type type, int status, const char *fmt, va_list args)
 {
 	const struct settings *set = settings_root->defaults;
+	va_list args2;
 
-	fprintf(stderr, "Fatal: %s\n", t_strdup_vprintf(fmt, args));
+	VA_COPY(args2, args);
+	fprintf(stderr, "Fatal: %s\n", t_strdup_vprintf(fmt, args2));
 
 	if (*set->log_path == '\0') {
 		i_syslog_fatal_handler(type, status, fmt, args);
@@ -157,8 +159,10 @@
 tee_error_handler(enum log_type type, const char *fmt, va_list args)
 {
 	const struct settings *set = settings_root->defaults;
+	va_list args2;
 
-	fprintf(stderr, "Error: %s\n", t_strdup_vprintf(fmt, args));
+	VA_COPY(args2, args);
+	fprintf(stderr, "Error: %s\n", t_strdup_vprintf(fmt, args2));
 
 	if (*set->log_path == '\0') {
 		i_syslog_error_handler(type, fmt, args);