libstore: use makeTempSiblingPath in replaceValidPath

Change-Id: I6a6a69643732c1bb4942425ae1f179a411412fd5
This commit is contained in:
Emily
2025-08-18 09:27:31 +00:00
committed by emilazy
parent e2d85579d8
commit a42cb1c43d
+1 -1
View File
@@ -762,7 +762,7 @@ void replaceValidPath(const Path & storePath, const Path & tmpPath)
Path oldPath;
if (pathExists(storePath)) {
do {
oldPath = makeTempPath(storePath, ".old");
oldPath = makeTempSiblingPath(storePath);
// store paths are often directories so we can't just unlink() it
// let's make sure the path doesn't exist before we try to use it
} while (pathExists(oldPath));