From c6a97e3b74289fdc8e57189212a0db3d0e6896e0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 24 Nov 2006 20:24:14 +0000 Subject: * Doh! Path sizes need to be computed recursively of course. (NIX-70) --- src/libstore/gc.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/libstore') diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index ed1b1a84a44c..3a626dedae98 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -528,12 +528,8 @@ void collectGarbage(GCAction action, const PathSet & pathsToDelete, /* If just returning the set of dead paths, we also return the space that would be freed if we deleted them. */ - if (action == gcReturnDead) { - struct stat st; - if (lstat(i->c_str(), &st) == -1) - st.st_size = 0; - bytesFreed += st.st_size; - } + if (action == gcReturnDead) + bytesFreed += computePathSize(*i); if (action == gcDeleteDead || action == gcDeleteSpecific) { -- cgit 1.4.1