]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Fix CORE_ERROR to work with all log types
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sat, 24 Feb 2024 22:17:51 +0000 (00:17 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Sun, 25 Feb 2024 10:37:30 +0000 (12:37 +0200)
It only worked when logging to a file, which practically made it nonworking.

src/lib/failures.c

index 1c5d82fdcb535bcabc86d29f6cbecd525e6b27f2..976ecc987bae5788f0a5afe9397853524897470a 100644 (file)
@@ -120,10 +120,8 @@ static void default_on_handler_failure(const struct failure_context *ctx)
        }
 }
 
-static void default_post_handler(const struct failure_context *ctx)
+static void default_post_handler(const struct failure_context *ctx ATTR_UNUSED)
 {
-       if (ctx->type == LOG_TYPE_ERROR && coredump_on_error)
-               abort();
 }
 
 static int ATTR_FORMAT(2, 0)
@@ -285,6 +283,8 @@ static void error_handler_real(const struct failure_context *ctx,
 {
        if (common_handler(ctx, format, args) < 0)
                failure_handler.v->on_handler_failure(ctx);
+       if (ctx->type == LOG_TYPE_ERROR && coredump_on_error)
+               abort();
        failure_handler.v->post_handler(ctx);
 }