1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-04 15:31:47 +02:00

use path for from arg in nix::copyFile

This commit is contained in:
siddhantCodes 2024-05-13 16:10:21 +05:30
parent ccf94545db
commit 62e1ea2f4b
3 changed files with 13 additions and 13 deletions

View file

@ -422,7 +422,7 @@ static void doBind(const Path & source, const Path & target, bool optional = fal
// Symlinks can (apparently) not be bind-mounted, so just copy it
createDirs(dirOf(target));
copyFile(
std::filesystem::directory_entry(std::filesystem::path(source)),
std::filesystem::path(source),
std::filesystem::path(target), false);
} else {
createDirs(dirOf(target));
@ -2571,7 +2571,7 @@ SingleDrvOutputs LocalDerivationGoal::registerOutputs()
// that there's no stale file descriptor pointing to it
Path tmpOutput = actualPath + ".tmp";
copyFile(
std::filesystem::directory_entry(std::filesystem::path(actualPath)),
std::filesystem::path(actualPath),
std::filesystem::path(tmpOutput), true);
std::filesystem::rename(tmpOutput, actualPath);