From fd63c8bfcd75624e7fbba8899365095400534e01 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 23 Jul 2012 18:06:37 -0400 Subject: [PATCH] Unlink the right file --- src/libstore/optimise-store.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstore/optimise-store.cc b/src/libstore/optimise-store.cc index a7aa14fb4..e5bfa332d 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);