]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Add i_failure_handler_is_internal()
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 26 Apr 2018 18:07:22 +0000 (21:07 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 27 Apr 2018 13:09:44 +0000 (13:09 +0000)
src/lib/failures.c
src/lib/failures.h

index 40bff2733e07e6186697c7fd05b6f9a3d5bfbe84..9e44dd9b8d5e13f929c925a363d897a951fdf7cb 100644 (file)
@@ -735,6 +735,12 @@ void i_set_failure_internal(void)
        i_set_debug_handler(i_internal_error_handler);
 }
 
+bool i_failure_handler_is_internal(failure_callback_t *const callback)
+{
+       return callback == i_internal_fatal_handler ||
+               callback == i_internal_error_handler;
+}
+
 void i_set_failure_ignore_errors(bool ignore)
 {
        failure_ignore_errors = ignore;
index ab18e4c877a0bcf7cf9a7325225c7434dd9a64ff..bcc369ead2f799123b902da593e71f099c9706b6 100644 (file)
@@ -103,6 +103,9 @@ void i_set_failure_file(const char *path, const char *prefix);
 
 /* Send errors to stderr using internal error protocol. */
 void i_set_failure_internal(void);
+/* Returns TRUE if the given callback handler was set via
+   i_set_failure_internal(). */
+bool i_failure_handler_is_internal(failure_callback_t *const callback);
 /* If writing to log fails, ignore it instead of existing with
    FATAL_LOGWRITE or FATAL_LOGERROR. */
 void i_set_failure_ignore_errors(bool ignore);