dovecot: Default failure functions are now public.

dovecot at dovecot.org dovecot at dovecot.org
Mon Feb 11 20:47:49 EET 2008


details:   http://hg.dovecot.org/dovecot/rev/45a083e03fba
changeset: 7228:45a083e03fba
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Feb 11 20:44:23 2008 +0200
description:
Default failure functions are now public.

diffstat:

2 files changed, 10 insertions(+), 11 deletions(-)
src/lib/failures.c |   14 +++-----------
src/lib/failures.h |    7 +++++++

diffs (55 lines):

diff -r d64b898066a9 -r 45a083e03fba src/lib/failures.c
--- a/src/lib/failures.c	Mon Feb 11 20:44:00 2008 +0200
+++ b/src/lib/failures.c	Mon Feb 11 20:44:23 2008 +0200
@@ -24,12 +24,6 @@ static char log_type_internal_chars[] = 
 static char log_type_internal_chars[] = {
 	'I', 'W', 'E', 'F', 'P'
 };
-
-static void default_fatal_handler(enum log_type type, int status,
-				  const char *format, va_list args)
-	ATTR_NORETURN ATTR_FORMAT(3, 0);
-static void default_error_handler(enum log_type type, const char *format,
-				  va_list args) ATTR_FORMAT(2, 0);
 
 /* Initialize working defaults */
 static fatal_failure_callback_t *fatal_handler ATTR_NORETURN =
@@ -144,9 +138,8 @@ default_handler(const char *prefix, int 
 	return ret;
 }
 
-static void ATTR_FORMAT(3, 0)
-default_fatal_handler(enum log_type type, int status,
-		      const char *format, va_list args)
+void default_fatal_handler(enum log_type type, int status,
+			   const char *format, va_list args)
 {
 	const char *backtrace;
 
@@ -165,8 +158,7 @@ default_fatal_handler(enum log_type type
 		failure_exit(status);
 }
 
-static void ATTR_FORMAT(2, 0)
-default_error_handler(enum log_type type, const char *format, va_list args)
+void default_error_handler(enum log_type type, const char *format, va_list args)
 {
 	int fd = type == LOG_TYPE_INFO ? log_info_fd : log_fd;
 
diff -r d64b898066a9 -r 45a083e03fba src/lib/failures.h
--- a/src/lib/failures.h	Mon Feb 11 20:44:00 2008 +0200
+++ b/src/lib/failures.h	Mon Feb 11 20:44:23 2008 +0200
@@ -49,6 +49,13 @@ void i_set_error_handler(failure_callbac
 void i_set_error_handler(failure_callback_t *callback);
 void i_set_info_handler(failure_callback_t *callback);
 
+/* Send failures to file. */
+void default_fatal_handler(enum log_type type, int status,
+			   const char *format, va_list args)
+	ATTR_NORETURN ATTR_FORMAT(3, 0);
+void default_error_handler(enum log_type type, const char *format, va_list args)
+	ATTR_FORMAT(2, 0);
+
 /* Send failures to syslog() */
 void i_syslog_fatal_handler(enum log_type type, int status,
 			    const char *fmt, va_list args)


More information about the dovecot-cvs mailing list