提交 97e70e8f 编写于 作者: A Alex Duan

fix(all): coverity scan problem fixed

上级 d23b829c
......@@ -191,7 +191,7 @@ int32_t taosRenameFile(const char *oldName, const char *newName) {
printf("failed to rename file %s to %s, reason:%s\n", oldName, newName, strerror(errno));
}
return code ? 0 : 1;
return code ? 0 : -1;
#else
int32_t code = rename(oldName, newName);
if (code < 0) {
......
......@@ -2275,6 +2275,7 @@ int32_t tsCompressBool(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int32_t
} else if (cmprAlg == TWO_STAGE_COMP) {
int32_t len = tsCompressBoolImp(pIn, nEle, pBuf);
if (len < 0) {
strerror(errno));
return -1;
}
return tsCompressStringImp(pBuf, len, pOut, nOut);
......
......@@ -109,9 +109,7 @@ void tEndEncode(SEncoder* pCoder) {
pCoder->size = pNode->size;
pCoder->pos = pNode->pos;
if (tEncodeI32(pCoder, len) < 0) {
return;
}
(void)tEncodeI32(pCoder, len);
TD_CODER_MOVE_POS(pCoder, len);
}
......
......@@ -207,9 +207,7 @@ static void taosKeepOldLog(char *oldName) {
char fileName[LOG_FILE_NAME_LEN + 20];
snprintf(fileName, LOG_FILE_NAME_LEN + 20, "%s.%" PRId64, tsLogObj.logName, fileSec);
if (taosRenameFile(oldName, fileName) != 0) {
return;
}
(void)taosRenameFile(oldName, fileName);
if (tsLogKeepDays < 0) {
char compressFileName[LOG_FILE_NAME_LEN + 20];
......
......@@ -356,9 +356,9 @@ void enumFromTree(STire* tire, SMatch* match) {
}
// this branch have data
if (c->end)
if (c->end) {
addWordToMatch(match, pre);
else {
} else {
matchPrefix(tire, pre, match);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册