diff --git a/src/watchman/WatchmanBackend.cc b/src/watchman/WatchmanBackend.cc index 5933acf..6044c85 100644 --- a/src/watchman/WatchmanBackend.cc +++ b/src/watchman/WatchmanBackend.cc @@ -248,6 +248,8 @@ void WatchmanBackend::writeSnapshot(Watcher &watcher, std::string *snapshotPath) { std::ofstream ofs(temporaryFilePath); ofs << clockValue; + ofs.flush(); + ofs.close(); } std::filesystem::rename(temporaryFilePath, *snapshotPath); }