mirror of
https://github.com/NixOS/nix
synced 2025-06-27 08:31:16 +02:00
* Automatically remove temporary root files.
This commit is contained in:
parent
252c9c91ab
commit
207bdcbe86
3 changed files with 30 additions and 1 deletions
|
@ -13,6 +13,7 @@ extern "C" {
|
|||
}
|
||||
|
||||
#include "globals.hh"
|
||||
#include "gc.hh"
|
||||
#include "shared.hh"
|
||||
|
||||
#include "config.h"
|
||||
|
@ -55,6 +56,15 @@ void checkStoreNotSymlink(Path path)
|
|||
}
|
||||
|
||||
|
||||
struct RemoveTempRoots
|
||||
{
|
||||
~RemoveTempRoots()
|
||||
{
|
||||
removeTempRoots();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void initDerivationsHelpers();
|
||||
|
||||
|
||||
|
@ -171,6 +181,10 @@ static void initAndRun(int argc, char * * argv)
|
|||
else remaining.push_back(arg);
|
||||
}
|
||||
|
||||
/* Automatically clean up the temporary roots file when we
|
||||
exit. */
|
||||
RemoveTempRoots removeTempRoots;
|
||||
|
||||
run(remaining);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue