1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-14 22:42:41 +01:00

Only use renameFile where needed

In most places the fallback to copying isn’t needed and can actually be
bad, so we’d rather not transparently fallback
This commit is contained in:
Théophane Hufschmitt 2022-04-13 14:19:42 +02:00
parent d71d9e9fbf
commit 90f9680733
3 changed files with 19 additions and 6 deletions

View file

@ -1430,7 +1430,7 @@ StorePath LocalStore::addToStoreFromDump(Source & source0, std::string_view name
writeFile(realPath, dumpSource);
} else {
/* Move the temporary path we restored above. */
renameFile(tempPath, realPath);
moveFile(tempPath, realPath);
}
/* For computing the nar hash. In recursive SHA-256 mode, this