more code
This commit is contained in:
parent
cc4a6608df
commit
921704e043
|
@ -76,7 +76,7 @@ static int32_t tSerializeSMonitorParas(SEncoder *encoder, const SMonitorParas *p
|
|||
TAOS_CHECK_RETURN(tEncodeI32(encoder, pMonitorParas->tsSlowLogScope));
|
||||
TAOS_CHECK_RETURN(tEncodeI32(encoder, pMonitorParas->tsSlowLogMaxLen));
|
||||
TAOS_CHECK_RETURN(tEncodeI32(encoder, pMonitorParas->tsSlowLogThreshold));
|
||||
TAOS_CHECK_RETURN(tEncodeI32(encoder, pMonitorParas->tsSlowLogThresholdTest)); //Obsolete
|
||||
TAOS_CHECK_RETURN(tEncodeI32(encoder, pMonitorParas->tsSlowLogThresholdTest)); // Obsolete
|
||||
TAOS_CHECK_RETURN(tEncodeCStr(encoder, pMonitorParas->tsSlowLogExceptDb));
|
||||
return 0;
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ static int32_t tDeserializeSMonitorParas(SDecoder *decoder, SMonitorParas *pMoni
|
|||
TAOS_CHECK_RETURN(tDecodeI32(decoder, &pMonitorParas->tsSlowLogScope));
|
||||
TAOS_CHECK_RETURN(tDecodeI32(decoder, &pMonitorParas->tsSlowLogMaxLen));
|
||||
TAOS_CHECK_RETURN(tDecodeI32(decoder, &pMonitorParas->tsSlowLogThreshold));
|
||||
TAOS_CHECK_RETURN(tDecodeI32(decoder, &pMonitorParas->tsSlowLogThresholdTest)); //Obsolete
|
||||
TAOS_CHECK_RETURN(tDecodeI32(decoder, &pMonitorParas->tsSlowLogThresholdTest)); // Obsolete
|
||||
TAOS_CHECK_RETURN(tDecodeCStrTo(decoder, pMonitorParas->tsSlowLogExceptDb));
|
||||
return 0;
|
||||
}
|
||||
|
@ -10182,7 +10182,7 @@ int tDecodeSVCreateTbReq(SDecoder *pCoder, SVCreateTbReq *pReq) {
|
|||
char name[TSDB_COL_NAME_LEN] = {0};
|
||||
char *tmp = NULL;
|
||||
TAOS_CHECK_EXIT(tDecodeCStr(pCoder, &tmp));
|
||||
strncpy(name, tmp, TSDB_COL_NAME_LEN - 1);
|
||||
tstrncpy(name, tmp, TSDB_COL_NAME_LEN);
|
||||
if (taosArrayPush(pReq->ctb.tagName, name) == NULL) {
|
||||
TAOS_CHECK_EXIT(terrno);
|
||||
}
|
||||
|
@ -12218,7 +12218,7 @@ void setFieldWithOptions(SFieldWithOptions *fieldWithOptions, SField *field) {
|
|||
fieldWithOptions->bytes = field->bytes;
|
||||
fieldWithOptions->flags = field->flags;
|
||||
fieldWithOptions->type = field->type;
|
||||
strncpy(fieldWithOptions->name, field->name, TSDB_COL_NAME_LEN);
|
||||
tstrncpy(fieldWithOptions->name, field->name, TSDB_COL_NAME_LEN);
|
||||
}
|
||||
int32_t tSerializeTableTSMAInfoReq(void *buf, int32_t bufLen, const STableTSMAInfoReq *pReq) {
|
||||
SEncoder encoder = {0};
|
||||
|
|
|
@ -1434,7 +1434,7 @@ static void debugPrintTagVal(int8_t type, const void *val, int32_t vlen, const c
|
|||
case TSDB_DATA_TYPE_NCHAR:
|
||||
case TSDB_DATA_TYPE_GEOMETRY: {
|
||||
char tmpVal[32] = {0};
|
||||
strncpy(tmpVal, val, vlen > 31 ? 31 : vlen);
|
||||
tstrncpy(tmpVal, val, vlen > 31 ? 31 : vlen);
|
||||
printf("%s:%d type:%d vlen:%d, val:\"%s\"\n", tag, ln, (int32_t)type, vlen, tmpVal);
|
||||
} break;
|
||||
case TSDB_DATA_TYPE_FLOAT:
|
||||
|
|
|
@ -81,7 +81,7 @@ SName* tNameDup(const SName* name) {
|
|||
}
|
||||
|
||||
int32_t tNameGetDbName(const SName* name, char* dst) {
|
||||
strncpy(dst, name->dbname, tListLen(name->dbname));
|
||||
tstrncpy(dst, name->dbname, tListLen(name->dbname));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1316,7 +1316,7 @@ static int32_t tm2char(const SArray* formats, const struct STm* tm, char* s, int
|
|||
TSFormatNode* format = taosArrayGet(formats, i);
|
||||
if (format->type != TS_FORMAT_NODE_TYPE_KEYWORD) {
|
||||
if (s - start + format->len + 1 > outLen) break;
|
||||
(void)strncpy(s, format->c, format->len);
|
||||
tstrncpy(s, format->c, format->len);
|
||||
s += format->len;
|
||||
continue;
|
||||
}
|
||||
|
@ -1536,7 +1536,7 @@ static const char* tsFormatStr2Int32(int32_t* dest, const char* str, int32_t len
|
|||
s = last;
|
||||
} else {
|
||||
char buf[16] = {0};
|
||||
(void)strncpy(buf, s, len);
|
||||
tstrncpy(buf, s, len);
|
||||
int32_t copiedLen = strlen(buf);
|
||||
if (copiedLen < len) {
|
||||
if (!needMoreDigit) {
|
||||
|
|
|
@ -211,7 +211,7 @@ static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) {
|
|||
#if defined(TD_ENTERPRISE)
|
||||
pCfg->tdbEncryptAlgorithm = pCreate->encryptAlgorithm;
|
||||
if (pCfg->tdbEncryptAlgorithm == DND_CA_SM4) {
|
||||
strncpy(pCfg->tdbEncryptKey, tsEncryptKey, ENCRYPT_KEY_LEN);
|
||||
tstrncpy(pCfg->tdbEncryptKey, tsEncryptKey, ENCRYPT_KEY_LEN);
|
||||
}
|
||||
#else
|
||||
pCfg->tdbEncryptAlgorithm = 0;
|
||||
|
|
|
@ -551,7 +551,7 @@ int32_t dmGetEncryptKey() {
|
|||
goto _OVER;
|
||||
}
|
||||
|
||||
strncpy(tsEncryptKey, encryptKey, ENCRYPT_KEY_LEN + 1);
|
||||
tstrncpy(tsEncryptKey, encryptKey, ENCRYPT_KEY_LEN + 1);
|
||||
taosMemoryFreeClear(encryptKey);
|
||||
tsEncryptionKeyChksum = taosCalcChecksum(0, tsEncryptKey, strlen(tsEncryptKey));
|
||||
tsEncryptionKeyStat = ENCRYPT_KEY_STAT_LOADED;
|
||||
|
|
|
@ -197,7 +197,7 @@ static int32_t metaOpenImpl(SVnode *pVnode, SMeta **ppMeta, const char *metaDir,
|
|||
code = tdbTbOpen("suid.idx", sizeof(tb_uid_t), 0, uidIdxKeyCmpr, pMeta->pEnv, &pMeta->pSuidIdx, 0);
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
|
||||
sprintf(indexFullPath, "%s/%s", pMeta->path, "invert");
|
||||
tsnprintf(indexFullPath, sizeof(indexFullPath), "%s/%s", pMeta->path, "invert");
|
||||
ret = taosMkDir(indexFullPath);
|
||||
|
||||
SIndexOpts opts = {.cacheSize = 8 * 1024 * 1024};
|
||||
|
@ -209,7 +209,7 @@ static int32_t metaOpenImpl(SVnode *pVnode, SMeta **ppMeta, const char *metaDir,
|
|||
|
||||
// open pTtlMgr ("ttlv1.idx")
|
||||
char logPrefix[128] = {0};
|
||||
sprintf(logPrefix, "vgId:%d", TD_VID(pVnode));
|
||||
tsnprintf(logPrefix, sizeof(logPrefix), "vgId:%d", TD_VID(pVnode));
|
||||
code = ttlMgrOpen(&pMeta->pTtlMgr, pMeta->pEnv, 0, logPrefix, tsTtlFlushThreshold);
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
|
||||
|
|
|
@ -164,7 +164,7 @@ int metaGetTableSzNameByUid(void *meta, uint64_t uid, char *tbName) {
|
|||
metaReaderClear(&mr);
|
||||
return code;
|
||||
}
|
||||
strncpy(tbName, mr.me.name, TSDB_TABLE_NAME_LEN);
|
||||
tstrncpy(tbName, mr.me.name, TSDB_TABLE_NAME_LEN);
|
||||
metaReaderClear(&mr);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -174,7 +174,6 @@ static int32_t tsdbWriteFilePage(STsdbFD *pFD, int32_t encryptAlgorithm, char *e
|
|||
opts.source = pFD->pBuf + count;
|
||||
opts.result = PacketData;
|
||||
opts.unitLen = 128;
|
||||
// strncpy(opts.key, tsEncryptKey, 16);
|
||||
tstrncpy(opts.key, encryptKey, ENCRYPT_KEY_LEN + 1);
|
||||
|
||||
NewLen = CBC_Encrypt(&opts);
|
||||
|
@ -248,7 +247,6 @@ static int32_t tsdbReadFilePage(STsdbFD *pFD, int64_t pgno, int32_t encryptAlgor
|
|||
opts.source = pFD->pBuf + count;
|
||||
opts.result = PacketData;
|
||||
opts.unitLen = 128;
|
||||
// strncpy(opts.key, tsEncryptKey, 16);
|
||||
tstrncpy(opts.key, encryptKey, ENCRYPT_KEY_LEN + 1);
|
||||
|
||||
NewLen = CBC_Decrypt(&opts);
|
||||
|
|
|
@ -330,7 +330,7 @@ static int32_t vnodeAsyncInit(SVAsync **async, const char *label) {
|
|||
return terrno;
|
||||
}
|
||||
|
||||
strcpy((char *)((*async) + 1), label);
|
||||
tstrncpy((char *)((*async) + 1), label, strlen(label) + 1);
|
||||
(*async)->label = (const char *)((*async) + 1);
|
||||
|
||||
(void)taosThreadMutexInit(&(*async)->mutex, NULL);
|
||||
|
|
|
@ -303,7 +303,7 @@ int vnodeDecodeConfig(const SJson *pJson, void *pObj) {
|
|||
if (tsEncryptKey[0] == 0) {
|
||||
return terrno = TSDB_CODE_DNODE_INVALID_ENCRYPTKEY;
|
||||
} else {
|
||||
strncpy(pCfg->tdbEncryptKey, tsEncryptKey, ENCRYPT_KEY_LEN);
|
||||
tstrncpy(pCfg->tdbEncryptKey, tsEncryptKey, ENCRYPT_KEY_LEN);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -168,7 +168,7 @@ int32_t vnodeAlterReplica(const char *path, SAlterVnodeReplicaReq *pReq, int32_t
|
|||
|
||||
static int32_t vnodeVgroupIdLen(int32_t vgId) {
|
||||
char tmp[TSDB_FILENAME_LEN];
|
||||
sprintf(tmp, "%d", vgId);
|
||||
tsnprintf(tmp, TSDB_FILENAME_LEN, "%d", vgId);
|
||||
return strlen(tmp);
|
||||
}
|
||||
|
||||
|
@ -417,7 +417,7 @@ SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgC
|
|||
}
|
||||
|
||||
pVnode->path = (char *)&pVnode[1];
|
||||
strcpy(pVnode->path, path);
|
||||
tstrncpy(pVnode->path, path, strlen(path) + 1);
|
||||
pVnode->config = info.config;
|
||||
pVnode->state.committed = info.state.committed;
|
||||
pVnode->state.commitTerm = info.state.commitTerm;
|
||||
|
@ -472,7 +472,7 @@ SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgC
|
|||
}
|
||||
|
||||
// open wal
|
||||
sprintf(tdir, "%s%s%s", dir, TD_DIRSEP, VNODE_WAL_DIR);
|
||||
tsnprintf(tdir, sizeof(tdir), "%s%s%s", dir, TD_DIRSEP, VNODE_WAL_DIR);
|
||||
ret = taosRealPath(tdir, NULL, sizeof(tdir));
|
||||
TAOS_UNUSED(ret);
|
||||
|
||||
|
@ -484,7 +484,7 @@ SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgC
|
|||
}
|
||||
|
||||
// open tq
|
||||
sprintf(tdir, "%s%s%s", dir, TD_DIRSEP, VNODE_TQ_DIR);
|
||||
tsnprintf(tdir, sizeof(tdir), "%s%s%s", dir, TD_DIRSEP, VNODE_TQ_DIR);
|
||||
ret = taosRealPath(tdir, NULL, sizeof(tdir));
|
||||
TAOS_UNUSED(ret);
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ int32_t vnodeGetTableMeta(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
|
|||
(void)memcpy(metaRsp.dbFName, infoReq.dbFName, sizeof(metaRsp.dbFName));
|
||||
|
||||
if (!reqTbUid) {
|
||||
TAOS_UNUSED(sprintf(tableFName, "%s.%s", infoReq.dbFName, infoReq.tbName));
|
||||
tsnprintf(tableFName, TSDB_TABLE_FNAME_LEN, "%s.%s", infoReq.dbFName, infoReq.tbName);
|
||||
code = vnodeValidateTableHash(pVnode, tableFName);
|
||||
if (code) {
|
||||
goto _exit4;
|
||||
|
@ -223,7 +223,7 @@ int32_t vnodeGetTableCfg(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
|
|||
tstrncpy(cfgRsp.tbName, cfgReq.tbName, TSDB_TABLE_NAME_LEN);
|
||||
(void)memcpy(cfgRsp.dbFName, cfgReq.dbFName, sizeof(cfgRsp.dbFName));
|
||||
|
||||
(void)sprintf(tableFName, "%s.%s", cfgReq.dbFName, cfgReq.tbName);
|
||||
tsnprintf(tableFName, TSDB_TABLE_FNAME_LEN, "%s.%s", cfgReq.dbFName, cfgReq.tbName);
|
||||
code = vnodeValidateTableHash(pVnode, tableFName);
|
||||
if (code) {
|
||||
goto _exit;
|
||||
|
|
|
@ -1225,7 +1225,7 @@ static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t ver, void *pReq,
|
|||
}
|
||||
|
||||
// validate hash
|
||||
sprintf(tbName, "%s.%s", pVnode->config.dbname, pCreateReq->name);
|
||||
tsnprintf(tbName, TSDB_TABLE_FNAME_LEN, "%s.%s", pVnode->config.dbname, pCreateReq->name);
|
||||
if (vnodeValidateTableHash(pVnode, tbName) < 0) {
|
||||
cRsp.code = TSDB_CODE_VND_HASH_MISMATCH;
|
||||
if (taosArrayPush(rsp.pArray, &cRsp) == NULL) {
|
||||
|
@ -1518,7 +1518,7 @@ static int32_t vnodeProcessDropTbReq(SVnode *pVnode, int64_t ver, void *pReq, in
|
|||
pRsp->code = terrno;
|
||||
goto _exit;
|
||||
}
|
||||
strcpy(str, pDropTbReq->name);
|
||||
tstrncpy(str, pDropTbReq->name, TSDB_TABLE_FNAME_LEN);
|
||||
if (taosArrayPush(tbNames, &str) == NULL) {
|
||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
pRsp->code = terrno;
|
||||
|
|
|
@ -99,8 +99,8 @@ static int32_t initWktRegex(pcre2_code **ppRegex, pcre2_match_data **ppMatchData
|
|||
return terrno;
|
||||
}
|
||||
|
||||
(void)sprintf(
|
||||
wktPatternWithSpace,
|
||||
tsnprintf(
|
||||
wktPatternWithSpace, 1024,
|
||||
"^( *)point( *)z?m?( *)((empty)|(\\(( *)(([-+]?[0-9]+\\.?[0-9]*)|([-+]?[0-9]*\\.?[0-9]+))(e[-+]?[0-9]+)?(( "
|
||||
"*)(([-+]?[0-9]+\\.?[0-9]*)|([-+]?[0-9]*\\.?[0-9]+))(e[-+]?[0-9]+)?){1,3}( *)\\)))|linestring( *)z?m?( "
|
||||
"*)((empty)|(\\(( *)(([-+]?[0-9]+\\.?[0-9]*)|([-+]?[0-9]*\\.?[0-9]+))(e[-+]?[0-9]+)?(( "
|
||||
|
|
|
@ -692,7 +692,7 @@ int32_t syncGetArbToken(int64_t rid, char* outToken) {
|
|||
|
||||
memset(outToken, 0, TSDB_ARB_TOKEN_SIZE);
|
||||
(void)taosThreadMutexLock(&pSyncNode->arbTokenMutex);
|
||||
strncpy(outToken, pSyncNode->arbToken, TSDB_ARB_TOKEN_SIZE);
|
||||
tstrncpy(outToken, pSyncNode->arbToken, TSDB_ARB_TOKEN_SIZE);
|
||||
(void)taosThreadMutexUnlock(&pSyncNode->arbTokenMutex);
|
||||
|
||||
syncNodeRelease(pSyncNode);
|
||||
|
|
|
@ -262,7 +262,7 @@ int tdbPagerBegin(SPager *pPager, TXN *pTxn) {
|
|||
*/
|
||||
// Open the journal
|
||||
char jTxnFileName[TDB_FILENAME_LEN];
|
||||
sprintf(jTxnFileName, "%s.%" PRId64, pPager->jFileName, pTxn->txnId);
|
||||
tsnprintf(jTxnFileName, TDB_FILENAME_LEN, "%s.%" PRId64, pPager->jFileName, pTxn->txnId);
|
||||
pTxn->jfd = tdbOsOpen(jTxnFileName, TDB_O_CREAT | TDB_O_RDWR, 0755);
|
||||
if (TDB_FD_INVALID(pTxn->jfd)) {
|
||||
tdbError("failed to open file due to %s. jFileName:%s", strerror(errno), pPager->jFileName);
|
||||
|
@ -365,7 +365,7 @@ int tdbPagerCommit(SPager *pPager, TXN *pTxn) {
|
|||
|
||||
int tdbPagerPostCommit(SPager *pPager, TXN *pTxn) {
|
||||
char jTxnFileName[TDB_FILENAME_LEN];
|
||||
sprintf(jTxnFileName, "%s.%" PRId64, pPager->jFileName, pTxn->txnId);
|
||||
tsnprintf(jTxnFileName, TDB_FILENAME_LEN, "%s.%" PRId64, pPager->jFileName, pTxn->txnId);
|
||||
|
||||
// remove the journal file
|
||||
if (tdbOsClose(pTxn->jfd) < 0) {
|
||||
|
@ -595,7 +595,7 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) {
|
|||
}
|
||||
|
||||
char jTxnFileName[TDB_FILENAME_LEN];
|
||||
sprintf(jTxnFileName, "%s.%" PRId64, pPager->jFileName, pTxn->txnId);
|
||||
tsnprintf(jTxnFileName, TDB_FILENAME_LEN, "%s.%" PRId64, pPager->jFileName, pTxn->txnId);
|
||||
|
||||
if (tdbOsRemove(jTxnFileName) < 0 && errno != ENOENT) {
|
||||
tdbError("failed to remove file due to %s. file:%s", strerror(errno), jTxnFileName);
|
||||
|
@ -1179,7 +1179,7 @@ int tdbPagerRestoreJournals(SPager *pPager) {
|
|||
int dirLen = strlen(pPager->pEnv->dbName);
|
||||
memcpy(jname, pPager->pEnv->dbName, dirLen);
|
||||
jname[dirLen] = '/';
|
||||
sprintf(jname + dirLen + 1, TDB_MAINDB_NAME "-journal.%" PRId64, *pTxnId);
|
||||
tsnprintf(jname + dirLen + 1, TD_PATH_MAX - dirLen - 1, TDB_MAINDB_NAME "-journal.%" PRId64, *pTxnId);
|
||||
code = tdbPagerRestore(pPager, jname);
|
||||
if (code) {
|
||||
taosArrayDestroy(pTxnList);
|
||||
|
|
|
@ -24,9 +24,6 @@ int32_t taosEnvNameToCfgName(const char *envNameStr, char *cfgNameStr, int32_t c
|
|||
char *p = cfgNameStr;
|
||||
if (envNameStr[0] != 'T' || envNameStr[1] != 'A' || envNameStr[2] != 'O' || envNameStr[3] != 'S' ||
|
||||
envNameStr[4] != '_') {
|
||||
// if(p != envNameStr) strncpy(p, envNameStr, cfgNameMaxLen - 1);
|
||||
// p[cfgNameMaxLen - 1] = '\0';
|
||||
// return strlen(cfgNameStr);
|
||||
cfgNameStr[0] = '\0';
|
||||
return TSDB_CODE_INVALID_PARA;
|
||||
}
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
#include "tconfig.h"
|
||||
#include "tglobal.h"
|
||||
#include "tjson.h"
|
||||
#include "tutil.h"
|
||||
#include "ttime.h"
|
||||
#include "tutil.h"
|
||||
|
||||
#define LOG_MAX_LINE_SIZE (10024)
|
||||
#define LOG_MAX_LINE_BUFFER_SIZE (LOG_MAX_LINE_SIZE + 3)
|
||||
|
@ -166,9 +166,9 @@ static int32_t taosStartLog() {
|
|||
}
|
||||
|
||||
static int32_t getDay(char *buf, int32_t bufSize) {
|
||||
time_t t;
|
||||
time_t t;
|
||||
int32_t code = taosTime(&t);
|
||||
if(code != 0) {
|
||||
if (code != 0) {
|
||||
return code;
|
||||
}
|
||||
struct tm tmInfo;
|
||||
|
@ -204,8 +204,8 @@ int32_t taosInitSlowLog() {
|
|||
|
||||
getFullPathName(tsLogObj.slowLogName, logFileName);
|
||||
|
||||
char name[PATH_MAX + TD_TIME_STR_LEN] = {0};
|
||||
char day[TD_TIME_STR_LEN] = {0};
|
||||
char name[PATH_MAX + TD_TIME_STR_LEN] = {0};
|
||||
char day[TD_TIME_STR_LEN] = {0};
|
||||
int32_t code = getDay(day, sizeof(day));
|
||||
if (code != 0) {
|
||||
(void)printf("failed to get day, reason:%s\n", tstrerror(code));
|
||||
|
@ -299,9 +299,7 @@ int32_t taosInitLog(const char *logName, int32_t maxFiles, bool tsc) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void taosSetNoNewFile() {
|
||||
tsLogObj.openInProgress = 1;
|
||||
}
|
||||
void taosSetNoNewFile() { tsLogObj.openInProgress = 1; }
|
||||
|
||||
static void taosStopLog() {
|
||||
if (tsLogObj.logHandle) {
|
||||
|
@ -503,7 +501,7 @@ static void taosOpenNewSlowLogFile() {
|
|||
taosWriteLog(tsLogObj.slowHandle);
|
||||
atomic_store_32(&tsLogObj.slowHandle->lock, 0);
|
||||
|
||||
char day[TD_TIME_STR_LEN] = {0};
|
||||
char day[TD_TIME_STR_LEN] = {0};
|
||||
int32_t code = getDay(day, sizeof(day));
|
||||
if (code != 0) {
|
||||
uError("failed to get day, reason:%s", tstrerror(code));
|
||||
|
@ -882,32 +880,6 @@ void taosPrintSlowLog(const char *format, ...) {
|
|||
taosMemoryFree(buffer);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void taosDumpData(unsigned char *msg, int32_t len) {
|
||||
if (!osLogSpaceAvailable()) return;
|
||||
taosUpdateLogNums(DEBUG_DUMP);
|
||||
|
||||
char temp[256] = {0};
|
||||
int32_t i, pos = 0, c = 0;
|
||||
|
||||
for (i = 0; i < len; ++i) {
|
||||
sprintf(temp + pos, "%02x ", msg[i]);
|
||||
c++;
|
||||
pos += 3;
|
||||
if (c >= 16) {
|
||||
temp[pos++] = '\n';
|
||||
TAOS_UNUSED((taosWriteFile(tsLogObj.logHandle->pFile, temp, (uint32_t)pos) <= 0));
|
||||
c = 0;
|
||||
pos = 0;
|
||||
}
|
||||
}
|
||||
|
||||
temp[pos++] = '\n';
|
||||
|
||||
TAOS_UNUSED(taosWriteFile(tsLogObj.logHandle->pFile, temp, (uint32_t)pos));
|
||||
}
|
||||
#endif
|
||||
|
||||
static void taosCloseLogByFd(TdFilePtr pFile) {
|
||||
if (pFile != NULL) {
|
||||
taosUnLockLogFile(pFile);
|
||||
|
|
Loading…
Reference in New Issue