diff options
Diffstat (limited to 'src/libstore/gc.cc')
-rw-r--r-- | src/libstore/gc.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index e867feeda8df..fa3b84b7afc9 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -599,9 +599,13 @@ void LocalStore::collectGarbage(GCAction action, const PathSet & pathsToDelete, printMsg(lvlInfo, format("deleting `%1%'") % *i); /* Okay, it's safe to delete. */ - unsigned long long freed; - deleteFromStore(*i, freed); - bytesFreed += freed; + try { + unsigned long long freed; + deleteFromStore(*i, freed); + bytesFreed += freed; + } catch (PathInUse & e) { + printMsg(lvlError, format("warning: %1%") % e.msg()); + } #ifndef __CYGWIN__ if (fdLock != -1) |