[TD-3642]<fix>: fix staging directory resource leak
This commit is contained in:
parent
4aebd5bdf6
commit
e2ed5b9460
|
@ -238,9 +238,11 @@ static int32_t dnodeInitStorage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
TDIR *tdir = tfsOpendir("vnode_bak/.staging");
|
TDIR *tdir = tfsOpendir("vnode_bak/.staging");
|
||||||
if (tfsReaddir(tdir) != NULL) {
|
bool stagingNotEmpty = tfsReaddir(tdir) != NULL;
|
||||||
|
tfsClosedir(tdir);
|
||||||
|
|
||||||
|
if (stagingNotEmpty) {
|
||||||
dError("vnode_bak/.staging dir not empty, fix it first.");
|
dError("vnode_bak/.staging dir not empty, fix it first.");
|
||||||
tfsClosedir(tdir);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue