mirror of
https://github.com/NixOS/nix
synced 2025-06-24 22:11:15 +02:00
Add canon for path
This commit is contained in:
parent
9e26549c2b
commit
8fd15ac228
1 changed files with 2 additions and 1 deletions
|
@ -626,7 +626,8 @@ Path makeTempPath(const Path & root, const Path & suffix)
|
|||
{
|
||||
// start the counter at a random value to minimize issues with preexisting temp paths
|
||||
static std::atomic_uint_fast32_t counter(std::random_device{}());
|
||||
return fmt("%1%%2%-%3%-%4%", root, suffix, getpid(), counter.fetch_add(1, std::memory_order_relaxed));
|
||||
auto tmpRoot = canonPath(root.empty() ? defaultTempDir() : root, true);
|
||||
return fmt("%1%/%2%-%3%-%4%", tmpRoot, suffix, getpid(), counter.fetch_add(1, std::memory_order_relaxed));
|
||||
}
|
||||
|
||||
void createSymlink(const Path & target, const Path & link)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue