1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 13:21:47 +02:00

* Don't use ULLONG_MAX in maxFreed - use 0 to mean "no limit".

18446744073709551615ULL breaks on GCC 3.3.6 (`integer constant is
  too large for "long" type').
This commit is contained in:
Eelco Dolstra 2009-03-26 11:02:07 +00:00
parent 92f525ecf4
commit 5dd8fb2069
4 changed files with 8 additions and 10 deletions

View file

@ -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();
}

View file

@ -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;

View file

@ -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