about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/gc.cc5
-rw-r--r--src/libstore/gc.hh2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
index c02f59f2cca6..5f4f5b27ff79 100644
--- a/src/libstore/gc.cc
+++ b/src/libstore/gc.cc
@@ -304,7 +304,7 @@ static Paths topoSort(const PathSet & paths)
 
 
 void collectGarbage(GCAction action, const PathSet & pathsToDelete,
-    PathSet & result, unsigned long long & bytesFreed)
+    bool ignoreLiveness, PathSet & result, unsigned long long & bytesFreed)
 {
     result.clear();
     bytesFreed = 0;
@@ -323,7 +323,8 @@ void collectGarbage(GCAction action, const PathSet & pathsToDelete,
        permanent roots cannot increase now. */
     Path rootsDir = canonPath((format("%1%/%2%") % nixStateDir % gcRootsDir).str());
     PathSet roots;
-    findRoots(rootsDir, true, roots);
+    if (!ignoreLiveness)
+        findRoots(rootsDir, true, roots);
 
     if (action == gcReturnRoots) {
         result = roots;
diff --git a/src/libstore/gc.hh b/src/libstore/gc.hh
index b05d88f93088..c6b13bc471ac 100644
--- a/src/libstore/gc.hh
+++ b/src/libstore/gc.hh
@@ -21,7 +21,7 @@ typedef enum {
    set of paths not reachable from the roots.  If `action' is
    `gcDeleteDead', actually delete the latter set. */
 void collectGarbage(GCAction action, const PathSet & pathsToDelete,
-    PathSet & result, unsigned long long & bytesFreed);
+    bool ignoreLiveness, PathSet & result, unsigned long long & bytesFreed);
 
 /* Register a temporary GC root.  This root will automatically
    disappear when this process exits.  WARNING: this function should