aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/cas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenstore/cas.cpp')
-rw-r--r--src/zenstore/cas.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/zenstore/cas.cpp b/src/zenstore/cas.cpp
index 67790e2c6..f300c08e3 100644
--- a/src/zenstore/cas.cpp
+++ b/src/zenstore/cas.cpp
@@ -220,19 +220,7 @@ CasImpl::UpdateManifest()
ZEN_TRACE("Writing new manifest to '{}'", ManifestPath);
- TemporaryFile Marker;
- std::error_code Ec;
- Marker.CreateTemporary(ManifestPath.parent_path(), Ec);
- if (Ec)
- {
- throw std::system_error(Ec, fmt::format("Failed to create temp file for cas manifest at '{}'", ManifestPath));
- }
- Marker.Write(m_ManifestObject.GetBuffer(), 0);
- Marker.MoveTemporaryIntoPlace(ManifestPath, Ec);
- if (Ec)
- {
- throw std::system_error(Ec, fmt::format("Failed to move temp file '{}' to '{}'", Marker.GetPath(), ManifestPath));
- }
+ TemporaryFile::SafeWriteFile(ManifestPath, m_ManifestObject.GetBuffer().GetView());
}
CasStore::InsertResult