From 3c09bc1e088457c583b37d67c597ce2a0a72be8c Mon Sep 17 00:00:00 2001 From: Jeff Tao Date: Mon, 18 May 2020 03:32:25 +0000 Subject: [PATCH] add the error code --- src/client/src/tscUtil.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 40d058d189..4667606aa8 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -2169,18 +2169,27 @@ int tscSetMgmtIpListFromCfg(const char *first, const char *second) { tscMgmtIpSet.inUse = 0; if (first && first[0] != 0) { - if (strlen(first) >= TSDB_FQDN_LEN) return TSDB_CODE_INVALID_FQDN; + if (strlen(first) >= TSDB_FQDN_LEN) { + terrno = TSDB_CODE_INVALID_FQDN; + return -1; + } taosGetFqdnPortFromEp(first, tscMgmtIpSet.fqdn[tscMgmtIpSet.numOfIps], &tscMgmtIpSet.port[tscMgmtIpSet.numOfIps]); tscMgmtIpSet.numOfIps++; } if (second && second[0] != 0) { - if (strlen(second) >= TSDB_FQDN_LEN) return TSDB_CODE_INVALID_FQDN; + if (strlen(second) >= TSDB_FQDN_LEN) { + terrno = TSDB_CODE_INVALID_FQDN; + return -1; + } taosGetFqdnPortFromEp(second, tscMgmtIpSet.fqdn[tscMgmtIpSet.numOfIps], &tscMgmtIpSet.port[tscMgmtIpSet.numOfIps]); tscMgmtIpSet.numOfIps++; } - if ( tscMgmtIpSet.numOfIps == 0) return TSDB_CODE_INVALID_FQDN; + if ( tscMgmtIpSet.numOfIps == 0) { + terrno = TSDB_CODE_INVALID_FQDN; + return -1; + } return 0; } -- GitLab