summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/os_calls.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/os_calls.c b/common/os_calls.c
index a4c98a75..f02b8c65 100644
--- a/common/os_calls.c
+++ b/common/os_calls.c
@@ -668,6 +668,7 @@ int APP_CC
g_tcp_connect(int sck, const char *address, const char *port)
{
int res = 0;
+ char errorMsg[256];
struct addrinfo p;
struct addrinfo *h = (struct addrinfo *)NULL;
struct addrinfo *rp = (struct addrinfo *)NULL;
@@ -693,6 +694,12 @@ g_tcp_connect(int sck, const char *address, const char *port)
{
res = getaddrinfo(address, port, &p, &h);
}
+ if (res != 0)
+ {
+ snprintf(errorMsg, 255, "g_tcp_connect: getaddrinfo() failed: %s",
+ gai_strerror(res));
+ log_message(LOG_LEVEL_ERROR, errorMsg);
+ }
if (res > -1)
{
if (h != NULL)