mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 11:57:28 -03:00
util: Check for file being NULL in DirectoryCommit
This commit is contained in:
parent
4574904038
commit
ef712298c3
1 changed files with 4 additions and 2 deletions
|
@ -1047,8 +1047,10 @@ void DirectoryCommit(const fs::path &dirname)
|
|||
{
|
||||
#ifndef WIN32
|
||||
FILE* file = fsbridge::fopen(dirname, "r");
|
||||
fsync(fileno(file));
|
||||
fclose(file);
|
||||
if (file) {
|
||||
fsync(fileno(file));
|
||||
fclose(file);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue