1
0
Fork 0
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:
Eelco Dolstra 2005-01-31 21:20:59 +00:00
parent 252c9c91ab
commit 207bdcbe86
3 changed files with 30 additions and 1 deletions

View file

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