From 8f67b3588603483402440538d7dc326451bbe60d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 14 Jan 2007 16:24:49 +0000 Subject: * Make the garbage collector more resilient to certain consistency errors: in-use paths now cause a warning, not a fatal error. --- src/libstore/gc.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/libstore/gc.cc') 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) -- cgit v1.2.3