From 4bed0a0f3910463a6031b0a4b94332faf155381c Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 14 Sep 2020 17:16:23 +0800 Subject: [PATCH] [td-1391] update the error msg output info. --- src/util/src/tsocket.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/util/src/tsocket.c b/src/util/src/tsocket.c index 61896a86df..498fc6af6b 100644 --- a/src/util/src/tsocket.c +++ b/src/util/src/tsocket.c @@ -16,7 +16,7 @@ #include "os.h" #include "tulog.h" #include "tsocket.h" -#include "tutil.h" +#include "taoserror.h" int taosGetFqdn(char *fqdn) { char hostname[1024]; @@ -56,7 +56,13 @@ uint32_t taosGetIpFromFqdn(const char *fqdn) { freeaddrinfo(result); return ip; } else { - uError("failed get the ip address, fqdn:%s, code:%d, reason:%s", fqdn, ret, gai_strerror(ret)); + if (ret == EAI_SYSTEM) { + uError("failed to get the ip address, fqdn:%s, code:%d, reason:%s", fqdn, ret, strerror(errno)); + terrno = TAOS_SYSTEM_ERROR(errno); + } else { + uError("failed get the ip address, fqdn:%s, code:%d, reason:%s", fqdn, ret, gai_strerror(ret)); + } + return 0xFFFFFFFF; } } -- GitLab