diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2021-04-17 13:56:56 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2021-04-17 13:56:56 (GMT) |
commit | 58afc7858cffe180bafbae306db6be66d313b74b (patch) | |
tree | 6ccba3064e1b1d49faf1099d3d6fe3c600192819 /src/core/logs.h | |
parent | b25638b8b13ffa833414c6a7c48fffdac12eda61 (diff) |
Remove hardcoded run paths from libraries.
Diffstat (limited to 'src/core/logs.h')
-rw-r--r-- | src/core/logs.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/logs.h b/src/core/logs.h index d3a81b6..a58a5a8 100644 --- a/src/core/logs.h +++ b/src/core/logs.h @@ -25,6 +25,7 @@ #define _CORE_LOGS_H +#include <dlfcn.h> #include <errno.h> #include <netdb.h> #include <stdarg.h> @@ -105,6 +106,17 @@ void log_variadic_message(LogMessageType, const char *, ...); } \ while (0) +#define LOG_ERROR_DL_N(func) \ + do \ + { \ + const char *__msg_ptr; \ + __msg_ptr = dlerror(); \ + if (__msg_ptr == NULL) \ + __msg_ptr = "???"; \ + log_variadic_message(LMT_EXT_ERROR, "[%s:%u] %s: %s", __FUNCTION__, __LINE__, func, __msg_ptr); \ + } \ + while (0) + #define LOG_ERROR_GAI_N(func, errcode) \ do \ { \ |