about summary refs log tree commit diff
path: root/src/libstore/gc.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2007-08-28T09·39+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2007-08-28T09·39+0000
commite0d7e47862aa1b33292fb8d05e5d50ad4ebf3590 (patch)
treea5d96132410ba858faaea0352ef75c11c0a80091 /src/libstore/gc.cc
parent455a7b95776440a56fd5d545d3b9a01cbae1d8e7 (diff)
* PathLocks::lockPaths: don't allow reacquiring a lock we already
  hold.

Diffstat (limited to 'src/libstore/gc.cc')
-rw-r--r--src/libstore/gc.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
index 8ce717aaffaa..e2e6c23fd559 100644
--- a/src/libstore/gc.cc
+++ b/src/libstore/gc.cc
@@ -61,6 +61,8 @@ void createSymlink(const Path & link, const Path & target, bool careful)
     /* Create directories up to `gcRoot'. */
     createDirs(dirOf(link));
 
+    /* !!! shouldn't removing and creating the symlink be atomic? */
+
     /* Remove the old symlink. */
     if (pathExists(link)) {
         if (careful && (!isLink(link) || !isInStore(readLink(link))))
@@ -68,7 +70,7 @@ void createSymlink(const Path & link, const Path & target, bool careful)
         unlink(link.c_str());
     }
 
-    /* And create the new own. */
+    /* And create the new one. */
     if (symlink(target.c_str(), link.c_str()) == -1)
         throw SysError(format("symlinking `%1%' to `%2%'")
             % link % target);