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:
parent
934c58aa38
commit
a72709afd8
15 changed files with 252 additions and 166 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue