diff --git a/include/util/tutil.h b/include/util/tutil.h index 6c7517f630..6321d2011a 100644 --- a/include/util/tutil.h +++ b/include/util/tutil.h @@ -55,7 +55,7 @@ void taosIpPort2String(uint32_t ip, uint16_t port, char *str); void *tmemmem(const char *haystack, int hlen, const char *needle, int nlen); -int32_t parseCfgReal(const char *str, double *out); +int32_t parseCfgReal(const char *str, float *out); static FORCE_INLINE void taosEncryptPass(uint8_t *inBuf, size_t inLen, char *target) { T_MD5_CTX context; diff --git a/source/client/src/clientMonitor.c b/source/client/src/clientMonitor.c index 10e6695ee5..6144019fb8 100644 --- a/source/client/src/clientMonitor.c +++ b/source/client/src/clientMonitor.c @@ -691,7 +691,7 @@ static void monitorSendAllSlowLogFromTempDir(int64_t clusterId) { continue; } if (taosLockFile(pFile) < 0) { - tscError("failed to lock file:%s since %s, maybe used by other process", filename, terrstr()); + tscInfo("failed to lock file:%s since %s, maybe used by other process", filename, terrstr()); (void)taosCloseFile(&pFile); continue; } diff --git a/source/util/src/tconfig.c b/source/util/src/tconfig.c index b14b0823a3..9fc6061612 100644 --- a/source/util/src/tconfig.c +++ b/source/util/src/tconfig.c @@ -191,7 +191,7 @@ static int32_t cfgSetInt64(SConfigItem *pItem, const char *value, ECfgSrcType st } static int32_t cfgSetFloat(SConfigItem *pItem, const char *value, ECfgSrcType stype) { - double dval; + float dval = 0; TAOS_CHECK_RETURN(parseCfgReal(value, &dval)); if (dval < pItem->fmin || dval > pItem->fmax) { uError("cfg:%s, type:%s src:%s value:%f out of range[%f, %f]", pItem->name, cfgDtypeStr(pItem->dtype), @@ -473,7 +473,7 @@ int32_t cfgCheckRangeForDynUpdate(SConfig *pCfg, const char *name, const char *p } break; case CFG_DTYPE_FLOAT: case CFG_DTYPE_DOUBLE: { - double dval; + float dval = 0; int32_t code = parseCfgReal(pVal, &dval); if (code != TSDB_CODE_SUCCESS) { cfgUnLock(pCfg); diff --git a/source/util/src/tutil.c b/source/util/src/tutil.c index 94f514e208..6e26203d31 100644 --- a/source/util/src/tutil.c +++ b/source/util/src/tutil.c @@ -506,11 +506,11 @@ size_t twcsncspn(const TdUcs4 *wcs, size_t size, const TdUcs4 *reject, size_t rs return index; } -int32_t parseCfgReal(const char *str, double *out) { - double val; +int32_t parseCfgReal(const char *str, float *out) { + float val; char *endPtr; errno = 0; - val = taosStr2Double(str, &endPtr); + val = taosStr2Float(str, &endPtr); if (str == endPtr || errno == ERANGE || isnan(val)) { return terrno = TSDB_CODE_INVALID_CFG_VALUE; }