From: Timo Sirainen Date: Sat, 24 Feb 2024 22:17:51 +0000 (+0200) Subject: lib: Fix CORE_ERROR to work with all log types X-Git-Tag: 2.4.0~1755 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cadcdb60fa6540ede568aaca198bc2fc2f740d9f;p=thirdparty%2Fdovecot%2Fcore.git lib: Fix CORE_ERROR to work with all log types It only worked when logging to a file, which practically made it nonworking. --- diff --git a/src/lib/failures.c b/src/lib/failures.c index 1c5d82fdcb..976ecc987b 100644 --- a/src/lib/failures.c +++ b/src/lib/failures.c @@ -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); }