mirror of
https://github.com/NixOS/nix.git
synced 2025-12-03 15:40:59 +01:00
libstore: Use makeTempPath in optimizePath_
This was intended to be cherry-picked in 6aed9d877c,
but was left hanging. This is actually important for fixing [^]. emilazy let me know
of this bad cherry-pick and its significance.
[^]: https://github.com/NixOS/nix/issues/7273
Originally fixed by Lily Ballard <lily@ballards.net> in https://gerrit.lix.systems/c/lix/+/2100.
This commit is contained in:
parent
048a58d331
commit
d888846b68
1 changed files with 1 additions and 1 deletions
|
|
@ -234,7 +234,7 @@ void LocalStore::optimisePath_(
|
||||||
its timestamp back to 0. */
|
its timestamp back to 0. */
|
||||||
MakeReadOnly makeReadOnly(mustToggle ? dirOfPath : "");
|
MakeReadOnly makeReadOnly(mustToggle ? dirOfPath : "");
|
||||||
|
|
||||||
std::filesystem::path tempLink = fmt("%1%/.tmp-link-%2%-%3%", config->realStoreDir, getpid(), rand());
|
std::filesystem::path tempLink = makeTempPath(config->realStoreDir.get(), ".tmp-link");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
std::filesystem::create_hard_link(linkPath, tempLink);
|
std::filesystem::create_hard_link(linkPath, tempLink);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue