Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
safizn committed Feb 26, 2023
1 parent 9b3cdbe commit af269f2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ class Cache {
tmp_cache_file.close();
tmp_cache_file.flush(); // TODO: c++ implementation doesn't call fsync necessarily
unlink(this->fileCachePath.c_str());

// atomicity of rename - https://stackoverflow.com/questions/7054844/is-rename-atomic
if (rename(tmp_statusCachePath.c_str(), statusCachePath.c_str()) != 0) {
std::cout << red << "rename fail" << reset << std::endl;
}
Expand Down

0 comments on commit af269f2

Please sign in to comment.