From 06f62defe640517267a6a16dd222076c822f3123 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 20 Dec 2012 17:32:15 +0100 Subject: Yet another rewrite of the garbage collector But this time it's *obviously* correct! No more segfaults due to infinite recursions for sure, etc. Also, move directories to /nix/store/trash instead of renaming them to /nix/store/bla-gc-. Then we can just delete /nix/store/trash at the end. --- src/libstore/local-store.hh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/libstore/local-store.hh') diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh index ebf3f6e2b4e7..bb5a9143ceef 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/local-store.hh @@ -276,7 +276,11 @@ private: void deleteGarbage(GCState & state, const Path & path); - bool tryToDelete(GCState & state, const Path & path); + void tryToDelete(GCState & state, const Path & path); + + bool canReachRoot(GCState & state, PathSet & visited, const Path & path); + + void deletePathRecursive(GCState & state, const Path & path); bool isActiveTempFile(const GCState & state, const Path & path, const string & suffix); -- cgit 1.4.1