diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2022-02-22 13:03:35 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2022-02-22 13:03:35 (GMT) |
commit | 6238bc22b5ca4da5fa334c7f35ac3b0b052b70de (patch) | |
tree | 16cdea051e4a51fe48e1491e4128fb9a5d894374 | |
parent | fbde6e0ebfc5b0203eda1c5fe3c6ba72d1427896 (diff) |
Handle regcomp() errors as log messages.
-rw-r--r-- | src/core/logs.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/logs.h b/src/core/logs.h index a58a5a8..e8df8bd 100644 --- a/src/core/logs.h +++ b/src/core/logs.h @@ -130,6 +130,15 @@ void log_variadic_message(LogMessageType, const char *, ...); } \ while (0) +#define LOG_ERROR_REGCOMP(preg, errcode) \ + do \ + { \ + char __msg[1024]; \ + regerror(errcode, preg, __msg, sizeof(__msg)); \ + log_variadic_message(LMT_EXT_ERROR, "[%s:%u] regcomp: %s", __FUNCTION__, __LINE__, __msg); \ + } \ + while (0) + #define LOG_ERROR_OPENSSL \ do \ { \ |