mirror of
https://github.com/NixOS/nix
synced 2025-07-07 01:51:47 +02:00
Ensure that Perl processes delete their entry in the temproots directory
By moving the destructor object to libstore.so, it's also run when download-using-manifests and nix-prefetch-url exit. This prevents them from cluttering /nix/var/nix/temproots with stale files.
This commit is contained in:
parent
b461721f17
commit
bd50c01972
4 changed files with 12 additions and 17 deletions
|
@ -214,6 +214,18 @@ void removeTempRoots()
|
|||
}
|
||||
|
||||
|
||||
/* Automatically clean up the temporary roots file when we exit. */
|
||||
struct RemoveTempRoots
|
||||
{
|
||||
~RemoveTempRoots()
|
||||
{
|
||||
removeTempRoots();
|
||||
}
|
||||
};
|
||||
|
||||
static RemoveTempRoots autoRemoveTempRoots __attribute__((unused));
|
||||
|
||||
|
||||
typedef boost::shared_ptr<AutoCloseFD> FDPtr;
|
||||
typedef list<FDPtr> FDs;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue