definite lost
This commit is contained in:
parent
17b97e3739
commit
b6294c379c
|
@ -96,6 +96,7 @@ void cfgCleanup(SConfig *pCfg) {
|
||||||
SConfigItem *pItem = taosHashIterate(pCfg->hash, NULL);
|
SConfigItem *pItem = taosHashIterate(pCfg->hash, NULL);
|
||||||
while (pItem != NULL) {
|
while (pItem != NULL) {
|
||||||
cfgFreeItem(pItem);
|
cfgFreeItem(pItem);
|
||||||
|
tfree(pItem->name);
|
||||||
pItem = taosHashIterate(pCfg->hash, pItem);
|
pItem = taosHashIterate(pCfg->hash, pItem);
|
||||||
}
|
}
|
||||||
taosHashCleanup(pCfg->hash);
|
taosHashCleanup(pCfg->hash);
|
||||||
|
@ -249,9 +250,7 @@ static int32_t cfgSetString(SConfigItem *pItem, const char *value, ECfgSrcType s
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t cfgSetDir(SConfigItem *pItem, const char *value, ECfgSrcType stype) {
|
static int32_t cfgSetDir(SConfigItem *pItem, const char *value, ECfgSrcType stype) {
|
||||||
char *tmp = strdup(value);
|
if (cfgCheckAndSetDir(pItem, value) != 0) {
|
||||||
if (tmp == NULL || cfgCheckAndSetDir(pItem, value) != 0) {
|
|
||||||
free(tmp);
|
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
uError("cfg:%s, type:%s src:%s value:%s failed to dup since %s, use last src:%s value:%s", pItem->name,
|
uError("cfg:%s, type:%s src:%s value:%s failed to dup since %s, use last src:%s value:%s", pItem->name,
|
||||||
cfgDtypeStr(pItem->dtype), cfgStypeStr(stype), value, terrstr(), cfgStypeStr(pItem->stype), pItem->str);
|
cfgDtypeStr(pItem->dtype), cfgStypeStr(stype), value, terrstr(), cfgStypeStr(pItem->stype), pItem->str);
|
||||||
|
@ -263,9 +262,7 @@ static int32_t cfgSetDir(SConfigItem *pItem, const char *value, ECfgSrcType styp
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t cfgSetLocale(SConfigItem *pItem, const char *value, ECfgSrcType stype) {
|
static int32_t cfgSetLocale(SConfigItem *pItem, const char *value, ECfgSrcType stype) {
|
||||||
char *tmp = strdup(value);
|
if (cfgCheckAndSetLocale(pItem, value) != 0) {
|
||||||
if (tmp == NULL || cfgCheckAndSetLocale(pItem, value) != 0) {
|
|
||||||
free(tmp);
|
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
uError("cfg:%s, type:%s src:%s value:%s failed to dup since %s, use last src:%s value:%s", pItem->name,
|
uError("cfg:%s, type:%s src:%s value:%s failed to dup since %s, use last src:%s value:%s", pItem->name,
|
||||||
cfgDtypeStr(pItem->dtype), cfgStypeStr(stype), value, terrstr(), cfgStypeStr(pItem->stype), pItem->str);
|
cfgDtypeStr(pItem->dtype), cfgStypeStr(stype), value, terrstr(), cfgStypeStr(pItem->stype), pItem->str);
|
||||||
|
@ -277,9 +274,7 @@ static int32_t cfgSetLocale(SConfigItem *pItem, const char *value, ECfgSrcType s
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t cfgSetCharset(SConfigItem *pItem, const char *value, ECfgSrcType stype) {
|
static int32_t cfgSetCharset(SConfigItem *pItem, const char *value, ECfgSrcType stype) {
|
||||||
char *tmp = strdup(value);
|
if (cfgCheckAndSetCharset(pItem, value) != 0) {
|
||||||
if (tmp == NULL || cfgCheckAndSetCharset(pItem, value) != 0) {
|
|
||||||
free(tmp);
|
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
uError("cfg:%s, type:%s src:%s value:%s failed to dup since %s, use last src:%s value:%s", pItem->name,
|
uError("cfg:%s, type:%s src:%s value:%s failed to dup since %s, use last src:%s value:%s", pItem->name,
|
||||||
cfgDtypeStr(pItem->dtype), cfgStypeStr(stype), value, terrstr(), cfgStypeStr(pItem->stype), pItem->str);
|
cfgDtypeStr(pItem->dtype), cfgStypeStr(stype), value, terrstr(), cfgStypeStr(pItem->stype), pItem->str);
|
||||||
|
@ -291,9 +286,7 @@ static int32_t cfgSetCharset(SConfigItem *pItem, const char *value, ECfgSrcType
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t cfgSetTimezone(SConfigItem *pItem, const char *value, ECfgSrcType stype) {
|
static int32_t cfgSetTimezone(SConfigItem *pItem, const char *value, ECfgSrcType stype) {
|
||||||
char *tmp = strdup(value);
|
if (cfgCheckAndSetTimezone(pItem, value) != 0) {
|
||||||
if (tmp == NULL || cfgCheckAndSetTimezone(pItem, value) != 0) {
|
|
||||||
free(tmp);
|
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
uError("cfg:%s, type:%s src:%s value:%s failed to dup since %s, use last src:%s value:%s", pItem->name,
|
uError("cfg:%s, type:%s src:%s value:%s failed to dup since %s, use last src:%s value:%s", pItem->name,
|
||||||
cfgDtypeStr(pItem->dtype), cfgStypeStr(stype), value, terrstr(), cfgStypeStr(pItem->stype), pItem->str);
|
cfgDtypeStr(pItem->dtype), cfgStypeStr(stype), value, terrstr(), cfgStypeStr(pItem->stype), pItem->str);
|
||||||
|
|
|
@ -135,8 +135,6 @@ static void taosStopLog() {
|
||||||
|
|
||||||
void taosCloseLog() {
|
void taosCloseLog() {
|
||||||
taosStopLog();
|
taosStopLog();
|
||||||
// tsem_post(&(tsLogObj.logHandle->buffNotEmpty));
|
|
||||||
taosMsleep(LOG_MAX_INTERVAL / 1000);
|
|
||||||
if (taosCheckPthreadValid(tsLogObj.logHandle->asyncThread)) {
|
if (taosCheckPthreadValid(tsLogObj.logHandle->asyncThread)) {
|
||||||
pthread_join(tsLogObj.logHandle->asyncThread, NULL);
|
pthread_join(tsLogObj.logHandle->asyncThread, NULL);
|
||||||
}
|
}
|
||||||
|
@ -495,12 +493,6 @@ void taosPrintLongString(const char *flags, int32_t dflag, const char *format, .
|
||||||
if (dflag & DEBUG_SCREEN) write(1, buffer, (uint32_t)len);
|
if (dflag & DEBUG_SCREEN) write(1, buffer, (uint32_t)len);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
void taosCloseLog() {
|
|
||||||
taosCloseLogByFd(tsLogObj.logHandle->pFile);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void taosCloseLogByFd(TdFilePtr pFile) {
|
static void taosCloseLogByFd(TdFilePtr pFile) {
|
||||||
if (pFile != NULL) {
|
if (pFile != NULL) {
|
||||||
taosUnLockLogFile(pFile);
|
taosUnLockLogFile(pFile);
|
||||||
|
@ -533,15 +525,6 @@ _err:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
static void taosLogBuffDestroy(SLogBuff *tLogBuff) {
|
|
||||||
tsem_destroy(&(tLogBuff->buffNotEmpty));
|
|
||||||
pthread_mutex_destroy(&(tLogBuff->buffMutex));
|
|
||||||
free(tLogBuff->buffer);
|
|
||||||
tfree(tLogBuff);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void taosCopyLogBuffer(SLogBuff *tLogBuff, int32_t start, int32_t end, char *msg, int32_t msgLen) {
|
static void taosCopyLogBuffer(SLogBuff *tLogBuff, int32_t start, int32_t end, char *msg, int32_t msgLen) {
|
||||||
if (start > end) {
|
if (start > end) {
|
||||||
memcpy(LOG_BUF_BUFFER(tLogBuff) + end, msg, msgLen);
|
memcpy(LOG_BUF_BUFFER(tLogBuff) + end, msg, msgLen);
|
||||||
|
|
Loading…
Reference in New Issue