Skip to content

Commit

Permalink
fix: RsyncClient::ThreadMain not close file(OpenAtomFoundation#2302)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchengyu committed Jan 13, 2024
1 parent 73687f3 commit 6a7d441
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/rsync_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ void* RsyncClient::ThreadMain() {
std::string meta_file_path = GetLocalMetaFilePath();
std::ofstream outfile;
outfile.open(meta_file_path, std::ios_base::app);
if (!outfile.is_open()) {
LOG(FATAL) << "unable to open meta file " << meta_file_path << ", error:" << strerror(errno);
return
}
DEFER {
outfile.close();
};

std::string meta_rep;
uint64_t start_time = pstd::NowMicros();

Expand Down

0 comments on commit 6a7d441

Please sign in to comment.