diff options
| author | Dan Engelbrecht <[email protected]> | 2024-11-22 10:58:20 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-11-22 10:58:20 +0100 |
| commit | 36658631e3f29b27d08b36fa6cf143d6902b7789 (patch) | |
| tree | 8c618ec8081a40a479dc98dfd91b96b8b1e21e9c /src/zencore/filesystem.cpp | |
| parent | fixed off-by-one in GetPidStatus (Linux) which might cause spurious errors (#... (diff) | |
| download | zen-36658631e3f29b27d08b36fa6cf143d6902b7789.tar.xz zen-36658631e3f29b27d08b36fa6cf143d6902b7789.zip | |
fix inconsistencies in filecas due to failing to remove payload file during GC (#224)
make sure we rewrite filecas entries if chunk size changes (due to compression changes)
hardening of move/write files in filecas
if we encounter a filecas entry with mismatching size (due to pre-existing bug) we validate the file and update the index
if we find a bad filecas file on disk we now attempt to remove it
Diffstat (limited to 'src/zencore/filesystem.cpp')
| -rw-r--r-- | src/zencore/filesystem.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/zencore/filesystem.cpp b/src/zencore/filesystem.cpp index 93383a656..9ca5f1131 100644 --- a/src/zencore/filesystem.cpp +++ b/src/zencore/filesystem.cpp @@ -902,14 +902,14 @@ MoveToFile(std::filesystem::path Path, IoBuffer Data) { return false; } - int Ret = link(SourcePath.c_str(), Path.c_str()); + int Ret = rename(SourcePath.c_str(), Path.c_str()); if (Ret < 0) { int32_t err = errno; if (err == ENOENT) { zen::CreateDirectories(Path.parent_path()); - Ret = link(SourcePath.c_str(), Path.c_str()); + Ret = rename(SourcePath.c_str(), Path.c_str()); } } if (Ret < 0) |