enh:[TD-30996] Handling return value
This commit is contained in:
parent
c1d899aa1a
commit
bb142d8c9c
|
@ -1282,7 +1282,7 @@ int32_t checkRegexPattern(const char *pPattern) {
|
||||||
int32_t ret = regcomp(®ex, pPattern, cflags);
|
int32_t ret = regcomp(®ex, pPattern, cflags);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
char msgbuf[256] = {0};
|
char msgbuf[256] = {0};
|
||||||
regerror(ret, ®ex, msgbuf, tListLen(msgbuf));
|
(void)regerror(ret, ®ex, msgbuf, tListLen(msgbuf));
|
||||||
uError("Failed to compile regex pattern %s. reason %s", pPattern, msgbuf);
|
uError("Failed to compile regex pattern %s. reason %s", pPattern, msgbuf);
|
||||||
return TSDB_CODE_PAR_REGULAR_EXPRESSION_ERROR;
|
return TSDB_CODE_PAR_REGULAR_EXPRESSION_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -1307,7 +1307,7 @@ static UsingRegex **getRegComp(const char *pPattern) {
|
||||||
int32_t ret = regcomp(&pUsingRegex->pRegex, pPattern, cflags);
|
int32_t ret = regcomp(&pUsingRegex->pRegex, pPattern, cflags);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
char msgbuf[256] = {0};
|
char msgbuf[256] = {0};
|
||||||
regerror(ret, &pUsingRegex->pRegex, msgbuf, tListLen(msgbuf));
|
(void)regerror(ret, &pUsingRegex->pRegex, msgbuf, tListLen(msgbuf));
|
||||||
uError("Failed to compile regex pattern %s. reason %s", pPattern, msgbuf);
|
uError("Failed to compile regex pattern %s. reason %s", pPattern, msgbuf);
|
||||||
taosMemoryFree(pUsingRegex);
|
taosMemoryFree(pUsingRegex);
|
||||||
terrno = TSDB_CODE_PAR_REGULAR_EXPRESSION_ERROR;
|
terrno = TSDB_CODE_PAR_REGULAR_EXPRESSION_ERROR;
|
||||||
|
@ -1354,7 +1354,7 @@ static int32_t doExecRegexMatch(const char *pString, const char *pPattern) {
|
||||||
releaseRegComp(pUsingRegex);
|
releaseRegComp(pUsingRegex);
|
||||||
if (ret != 0 && ret != REG_NOMATCH) {
|
if (ret != 0 && ret != REG_NOMATCH) {
|
||||||
terrno = TSDB_CODE_PAR_REGULAR_EXPRESSION_ERROR;
|
terrno = TSDB_CODE_PAR_REGULAR_EXPRESSION_ERROR;
|
||||||
regerror(ret, &(*pUsingRegex)->pRegex, msgbuf, sizeof(msgbuf));
|
(void)regerror(ret, &(*pUsingRegex)->pRegex, msgbuf, sizeof(msgbuf));
|
||||||
uDebug("Failed to match %s with pattern %s, reason %s", pString, pPattern, msgbuf)
|
uDebug("Failed to match %s with pattern %s, reason %s", pString, pPattern, msgbuf)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue