Minor cleanup

Also, possible fix for #1310 on 32-bit systems.
This commit is contained in:
Eelco Dolstra 2017-04-10 11:12:45 +02:00
parent 95295482ea
commit 105f8ffc98
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
3 changed files with 5 additions and 15 deletions

View file

@ -679,7 +679,7 @@ void LocalStore::removeUnusedLinks(const GCState & state)
if (unlink(path.c_str()) == -1)
throw SysError(format("deleting %1%") % path);
state.results.bytesFreed += st.st_blocks * 512;
state.results.bytesFreed += st.st_blocks * 512ULL;
}
struct stat st;

View file

@ -26,14 +26,9 @@ struct Derivation;
struct OptimiseStats
{
unsigned long filesLinked;
unsigned long long bytesFreed;
unsigned long long blocksFreed;
OptimiseStats()
{
filesLinked = 0;
bytesFreed = blocksFreed = 0;
}
unsigned long filesLinked = 0;
unsigned long long bytesFreed = 0;
unsigned long long blocksFreed = 0;
};

View file

@ -81,12 +81,7 @@ struct GCResults
/* For `gcReturnDead', `gcDeleteDead' and `gcDeleteSpecific', the
number of bytes that would be or was freed. */
unsigned long long bytesFreed;
GCResults()
{
bytesFreed = 0;
}
unsigned long long bytesFreed = 0;
};