提交 e2ed5b94 编写于 作者: M Minglei Jin

[TD-3642]<fix>: fix staging directory resource leak

上级 4aebd5bd
......@@ -238,9 +238,11 @@ static int32_t dnodeInitStorage() {
}
TDIR *tdir = tfsOpendir("vnode_bak/.staging");
if (tfsReaddir(tdir) != NULL) {
dError("vnode_bak/.staging dir not empty, fix it first.");
bool stagingNotEmpty = tfsReaddir(tdir) != NULL;
tfsClosedir(tdir);
if (stagingNotEmpty) {
dError("vnode_bak/.staging dir not empty, fix it first.");
return -1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册