about summary refs log tree commit diff
path: root/src/libstore/gc.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-11-24T20·24+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-11-24T20·24+0000
commitc6a97e3b74289fdc8e57189212a0db3d0e6896e0 (patch)
tree45e9076f8a22a433725569148d24f7196991f76e /src/libstore/gc.cc
parenta76efaeb3f2c1d7de6d41bd0e883b92e2d0f3d7f (diff)
* Doh! Path sizes need to be computed recursively of course.
  (NIX-70)

Diffstat (limited to 'src/libstore/gc.cc')
-rw-r--r--src/libstore/gc.cc8
1 files changed, 2 insertions, 6 deletions
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) {