diff --git a/source/os/src/osFile.c b/source/os/src/osFile.c index cea4d6882e..94a10322ed 100644 --- a/source/os/src/osFile.c +++ b/source/os/src/osFile.c @@ -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) { diff --git a/source/util/src/tcompression.c b/source/util/src/tcompression.c index fbbe970c74..72b31fa238 100644 --- a/source/util/src/tcompression.c +++ b/source/util/src/tcompression.c @@ -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); diff --git a/source/util/src/tencode.c b/source/util/src/tencode.c index a925d1fc5e..7f8a0edfdd 100644 --- a/source/util/src/tencode.c +++ b/source/util/src/tencode.c @@ -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); } diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index 09d12029bc..618b80760f 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -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]; diff --git a/tools/shell/src/shellTire.c b/tools/shell/src/shellTire.c index 25defbf9a8..0ce0588cce 100644 --- a/tools/shell/src/shellTire.c +++ b/tools/shell/src/shellTire.c @@ -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); } }