diff options
Diffstat (limited to 'src/libstore')
-rw-r--r-- | src/libstore/gc.cc | 2 | ||||
-rw-r--r-- | src/libstore/store-api.cc | 8 | ||||
-rw-r--r-- | src/libstore/store-api.hh | 3 |
3 files changed, 4 insertions, 9 deletions
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 552016584..b5cc21de4 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -482,7 +482,7 @@ void LocalStore::gcPath(const GCOptions & options, GCResults & results, results.bytesFreed += bytesFreed; results.blocksFreed += blocksFreed; - if (results.bytesFreed > options.maxFreed) { + if (options.maxFreed && results.bytesFreed > options.maxFreed) { printMsg(lvlInfo, format("deleted more than %1% bytes; stopping") % options.maxFreed); throw GCLimitReached(); } diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index e80be1e68..eb75d3ada 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -5,12 +5,6 @@ #include <limits.h> -/* Needed for some ancient environments. */ -#ifndef ULLONG_MAX -#define ULLONG_MAX 18446744073709551615ULL -#endif - - namespace nix { @@ -18,7 +12,7 @@ GCOptions::GCOptions() { action = gcDeleteDead; ignoreLiveness = false; - maxFreed = ULLONG_MAX; + maxFreed = 0; maxLinks = 0; useAtime = false; maxAtime = (time_t) -1; diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index 1c6f73728..bac2f6b9a 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -56,7 +56,8 @@ struct GCOptions /* For `gcDeleteSpecific', the paths to delete. */ PathSet pathsToDelete; - /* Stop after at least `maxFreed' bytes have been freed. */ + /* Stop after at least `maxFreed' bytes have been freed. 0 means + no limit. */ unsigned long long maxFreed; /* Stop after the number of hard links to the Nix store directory |