diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-08-29 21:43:47 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-08-29 21:43:47 (GMT) |
commit | fa40856e942a7e1bd1cb2729645182c1fa717468 (patch) | |
tree | 954db169d2b734e661d904e502cd1c803f51c6ea /src/core | |
parent | 7f973e015eb59b626edc584a19a1ad3ffddf4867 (diff) |
Defined a new way to launch updates share servers.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/logs.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/logs.h b/src/core/logs.h index afdcfa2..4ddb6ab 100644 --- a/src/core/logs.h +++ b/src/core/logs.h @@ -26,6 +26,7 @@ #include <errno.h> +#include <netdb.h> #include <stdarg.h> #include <string.h> #include <openssl/err.h> @@ -87,6 +88,19 @@ void log_variadic_message(LogMessageType, const char *, ...); } \ while (0) +#define LOG_ERROR_GAI_N(func, errcode) \ + do \ + { \ + char __msg[1024]; \ + const char *__msg_ptr; \ + if (errcode == EAI_SYSTEM) \ + __msg_ptr = strerror_r(errno, __msg, sizeof(__msg)); \ + else \ + __msg_ptr = gai_strerror(errcode); \ + log_variadic_message(LMT_EXT_ERROR, "[%s:%u] %s: %s", __FUNCTION__, __LINE__, func, __msg_ptr); \ + } \ + while (0) + #define LOG_ERROR_OPENSSL \ do \ { \ |