From 9b9f06eec3c52ee18b4571997a216599958c47e2 Mon Sep 17 00:00:00 2001 From: dmchen Date: Mon, 28 Oct 2024 01:23:52 +0000 Subject: [PATCH] fix/TD-32622-add-lock-for-vnodes-fix-compile --- source/dnode/mgmt/mgmt_vnode/src/vmFile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmFile.c b/source/dnode/mgmt/mgmt_vnode/src/vmFile.c index 80170cfa56..866072bc1a 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmFile.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmFile.c @@ -204,6 +204,7 @@ int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt) { char file[PATH_MAX] = {0}; char realfile[PATH_MAX] = {0}; int32_t lino = 0; + int32_t ret = -1; int32_t nBytes = snprintf(file, sizeof(file), "%s%svnodes_tmp.json", pMgmt->path, TD_DIRSEP); if (nBytes <= 0 || nBytes >= sizeof(file)) { @@ -269,7 +270,7 @@ int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt) { dInfo("succeed to write vnodes file:%s, vnodes:%d", realfile, numOfVnodes); _OVER1: - int32_t ret = taosThreadMutexUnlock(&pMgmt->fileLock); + ret = taosThreadMutexUnlock(&pMgmt->fileLock); if (ret != 0) { dError("failed to unlock since %s", tstrerror(ret)); }