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

Address PR feedback on #6694

This commit is contained in:
Andrew Brooks 2022-09-12 11:33:23 -05:00
parent 84fe75a12a
commit 565d888e0f
2 changed files with 3 additions and 5 deletions

View file

@ -1433,7 +1433,6 @@ StorePath LocalStore::addToStoreFromDump(Source & source0, std::string_view name
} else {
/* Move the temporary path we restored above. */
moveFile(tempPath, realPath);
tempDirFd.close();
}
/* For computing the nar hash. In recursive SHA-256 mode, this
@ -1520,7 +1519,7 @@ std::pair<Path, AutoCloseFD> LocalStore::createTempDirInStore()
/* There is a slight possibility that `tmpDir' gets deleted by
the GC between createTempDir() and when we acquire a lock on it.
We'll repeat until 'tmpDir' exists and we've locked it. */
tmpDirFn = createTempDir(realStoreDir, "add");
tmpDirFn = createTempDir(realStoreDir, "tmp");
tmpDirFd = open(tmpDirFn.c_str(), O_RDONLY | O_DIRECTORY);
if (tmpDirFd.get() < 0) {
continue;