diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2007-01-14 16:24:49 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2007-01-14 16:24:49 +0000 |
commit | 8f67b3588603483402440538d7dc326451bbe60d (patch) | |
tree | 4c72877a8e2ea20379249eff1555d9eb6c7b600e /src/libstore/gc.cc | |
parent | 8659edc0981373a42f123cd7d84b9925be0123bc (diff) |
* Make the garbage collector more resilient to certain consistency
errors: in-use paths now cause a warning, not a fatal error.
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 e867feeda..fa3b84b7a 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) |