* Minor cleanup.
This commit is contained in:
parent
2d456fc35a
commit
23960e92df
|
@ -707,14 +707,12 @@ static Path _addToStore(bool fixed, bool recursive,
|
||||||
|
|
||||||
if (!readOnlyMode) addTempRoot(dstPath);
|
if (!readOnlyMode) addTempRoot(dstPath);
|
||||||
|
|
||||||
if (!readOnlyMode && !isValidPath(dstPath)) {
|
if (!readOnlyMode && !isValidPath(dstPath)) {
|
||||||
|
|
||||||
/* The first check above is an optimisation to prevent
|
/* The first check above is an optimisation to prevent
|
||||||
unnecessary lock acquisition. */
|
unnecessary lock acquisition. */
|
||||||
|
|
||||||
PathSet lockPaths;
|
PathLocks outputLock(singleton<PathSet, Path>(dstPath));
|
||||||
lockPaths.insert(dstPath);
|
|
||||||
PathLocks outputLock(lockPaths);
|
|
||||||
|
|
||||||
if (!isValidPath(dstPath)) {
|
if (!isValidPath(dstPath)) {
|
||||||
|
|
||||||
|
@ -764,9 +762,7 @@ Path addTextToStore(const string & suffix, const string & s,
|
||||||
|
|
||||||
if (!readOnlyMode && !isValidPath(dstPath)) {
|
if (!readOnlyMode && !isValidPath(dstPath)) {
|
||||||
|
|
||||||
PathSet lockPaths;
|
PathLocks outputLock(singleton<PathSet, Path>(dstPath));
|
||||||
lockPaths.insert(dstPath);
|
|
||||||
PathLocks outputLock(lockPaths);
|
|
||||||
|
|
||||||
if (!isValidPath(dstPath)) {
|
if (!isValidPath(dstPath)) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue