From d2c852c8e9fb873e519a1b7892e6294340b49a22 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 27 Oct 2020 11:12:03 +0000 Subject: [PATCH] TD-1762 --- src/dnode/src/dnodeCfg.c | 2 ++ src/dnode/src/dnodeEps.c | 2 ++ src/dnode/src/dnodeMInfos.c | 2 ++ src/vnode/src/vnodeCfg.c | 2 ++ src/vnode/src/vnodeVersion.c | 2 ++ 5 files changed, 10 insertions(+) diff --git a/src/dnode/src/dnodeCfg.c b/src/dnode/src/dnodeCfg.c index c4a1f6b450..16d109a13a 100644 --- a/src/dnode/src/dnodeCfg.c +++ b/src/dnode/src/dnodeCfg.c @@ -127,6 +127,7 @@ PARSE_CFG_OVER: if (content != NULL) free(content); if (root != NULL) cJSON_Delete(root); if (fp != NULL) fclose(fp); + terrno = 0; dnodeResetCfg(&cfg); return 0; @@ -155,6 +156,7 @@ static int32_t dnodeWriteCfg() { fflush(fp); fclose(fp); free(content); + terrno = 0; dInfo("successed to write %s", file); return 0; diff --git a/src/dnode/src/dnodeEps.c b/src/dnode/src/dnodeEps.c index 9627333fc3..af8f18e884 100644 --- a/src/dnode/src/dnodeEps.c +++ b/src/dnode/src/dnodeEps.c @@ -235,6 +235,7 @@ PRASE_EPS_OVER: dnodeResetEps(eps); if (eps) free(eps); + terrno = 0; return 0; } @@ -272,6 +273,7 @@ static int32_t dnodeWriteEps() { fflush(fp); fclose(fp); free(content); + terrno = 0; dInfo("successed to write %s", file); return 0; diff --git a/src/dnode/src/dnodeMInfos.c b/src/dnode/src/dnodeMInfos.c index 0fbb946869..5240b0d487 100644 --- a/src/dnode/src/dnodeMInfos.c +++ b/src/dnode/src/dnodeMInfos.c @@ -238,6 +238,7 @@ PARSE_MINFOS_OVER: if (content != NULL) free(content); if (root != NULL) cJSON_Delete(root); if (fp != NULL) fclose(fp); + terrno = 0; dnodeResetMInfos(&minfos); return 0; @@ -276,6 +277,7 @@ static int32_t dnodeWriteMInfos() { fflush(fp); fclose(fp); free(content); + terrno = 0; dInfo("successed to write %s", file); return 0; diff --git a/src/vnode/src/vnodeCfg.c b/src/vnode/src/vnodeCfg.c index d758c6a2d3..59eeb17d8f 100644 --- a/src/vnode/src/vnodeCfg.c +++ b/src/vnode/src/vnodeCfg.c @@ -262,6 +262,7 @@ PARSE_VCFG_ERROR: vnodeLoadCfg(pVnode, &vnodeMsg); } + terrno = 0; return ret; } @@ -316,6 +317,7 @@ int32_t vnodeWriteCfg(SMDCreateVnodeMsg *pMsg) { fflush(fp); fclose(fp); free(content); + terrno = 0; vInfo("vgId:%d, successed to write %s", pMsg->cfg.vgId, file); return TSDB_CODE_SUCCESS; diff --git a/src/vnode/src/vnodeVersion.c b/src/vnode/src/vnodeVersion.c index daac62f7c2..2d251ec298 100644 --- a/src/vnode/src/vnodeVersion.c +++ b/src/vnode/src/vnodeVersion.c @@ -70,6 +70,7 @@ PARSE_VER_ERROR: if (content != NULL) free(content); if (root != NULL) cJSON_Delete(root); if (fp != NULL) fclose(fp); + terrno = 0; return ret; } @@ -96,6 +97,7 @@ int32_t vnodeSaveVersion(SVnodeObj *pVnode) { fflush(fp); fclose(fp); free(content); + terrno = 0; vInfo("vgId:%d, successed to write %s, version:%" PRId64, pVnode->vgId, file, pVnode->fversion); return TSDB_CODE_SUCCESS; -- GitLab