about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-07-23T22·06-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-07-23T22·06-0400
commitfd63c8bfcd75624e7fbba8899365095400534e01 (patch)
treee7e173df4830f3c26d93e6a54ef9a5e107be7e4c /src/libstore
parent0f65793f94bd89c973482ac949be1e96e876762b (diff)
Unlink the right file
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/optimise-store.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstore/optimise-store.cc b/src/libstore/optimise-store.cc
index a7aa14fb49ab..e5bfa332dcc7 100644
--- a/src/libstore/optimise-store.cc
+++ b/src/libstore/optimise-store.cc
@@ -159,8 +159,8 @@ void LocalStore::optimisePath_(OptimiseStats & stats, const Path & path)
             printMsg(lvlInfo, format("`%1%' has maximum number of links") % linkPath);
 
             /* Unlink the temp link. */
-            if (unlink(linkPath.c_str()) == -1)
-                printMsg(lvlError, format("unable to unlink `%1%'") % linkPath);
+            if (unlink(tempLink.c_str()) == -1)
+                printMsg(lvlError, format("unable to unlink `%1%'") % tempLink);
             return;
         }
         throw SysError(format("cannot rename `%1%' to `%2%'") % tempLink % path);