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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user