diff options
Diffstat (limited to 'src/libstore/gc.cc')
-rw-r--r-- | src/libstore/gc.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index bdaf2946ca58..cb808b6d1b68 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -303,9 +303,11 @@ static Paths topoSort(const PathSet & paths) } -void collectGarbage(GCAction action, PathSet & result) +void collectGarbage(GCAction action, PathSet & result, + unsigned long long & bytesFreed) { result.clear(); + bytesFreed = 0; bool gcKeepOutputs = queryBoolSetting("gc-keep-outputs", false); @@ -452,7 +454,9 @@ void collectGarbage(GCAction action, PathSet & result) printMsg(lvlInfo, format("deleting `%1%'") % *i); /* Okay, it's safe to delete. */ - deleteFromStore(*i); + unsigned long long freed; + deleteFromStore(*i, freed); + bytesFreed += freed; if (fdLock != -1) /* Write token to stale (deleted) lock file. */ |