summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2022-02-22 13:03:35 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2022-02-22 13:03:35 (GMT)
commit6238bc22b5ca4da5fa334c7f35ac3b0b052b70de (patch)
tree16cdea051e4a51fe48e1491e4128fb9a5d894374 /src/core
parentfbde6e0ebfc5b0203eda1c5fe3c6ba72d1427896 (diff)
Handle regcomp() errors as log messages.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/logs.h9
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 \
{ \