1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-02 01:01:48 +02:00

* Some refactoring: put the GC options / results in separate structs.

* The garbage collector now also prints the number of blocks freed.
This commit is contained in:
Eelco Dolstra 2008-06-18 09:34:17 +00:00
parent 934c58aa38
commit a72709afd8
15 changed files with 252 additions and 166 deletions

View file

@ -578,17 +578,17 @@ void getOwnership(const Path & path)
void deletePathWrapped(const Path & path,
unsigned long long & bytesFreed)
unsigned long long & bytesFreed, unsigned long long & blocksFreed)
{
try {
/* First try to delete it ourselves. */
deletePath(path, bytesFreed);
deletePath(path, bytesFreed, blocksFreed);
} catch (SysError & e) {
/* If this failed due to a permission error, then try it with
the setuid helper. */
if (haveBuildUsers() && !amPrivileged()) {
getOwnership(path);
deletePath(path, bytesFreed);
deletePath(path, bytesFreed, blocksFreed);
} else
throw;
}
@ -597,8 +597,8 @@ void deletePathWrapped(const Path & path,
void deletePathWrapped(const Path & path)
{
unsigned long long dummy;
deletePathWrapped(path, dummy);
unsigned long long dummy1, dummy2;
deletePathWrapped(path, dummy1, dummy2);
}