From bd50c01972718167cf86d20dcd9c928b4c3cfbd8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 13 Mar 2012 17:07:49 +0100 Subject: 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. --- src/libmain/shared.cc | 10 ---------- src/libmain/shared.hh | 5 ----- 2 files changed, 15 deletions(-) (limited to 'src/libmain') diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index 99ac198ca3..d398165864 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -90,12 +90,6 @@ static void setLogType(string lt) } -RemoveTempRoots::~RemoveTempRoots() -{ - removeTempRoots(); -} - - static bool showTrace = false; @@ -217,10 +211,6 @@ static void initAndRun(int argc, char * * argv) verbosityDelta += queryIntSetting("verbosity", lvlInfo); verbosity = (Verbosity) (verbosityDelta < 0 ? 0 : verbosityDelta); - /* Automatically clean up the temporary roots file when we - exit. */ - RemoveTempRoots removeTempRoots __attribute__((unused)); - run(remaining); /* Close the Nix database. */ diff --git a/src/libmain/shared.hh b/src/libmain/shared.hh index 43725e07fd..d198df70d1 100644 --- a/src/libmain/shared.hh +++ b/src/libmain/shared.hh @@ -48,11 +48,6 @@ extern bool setuidMode; extern volatile ::sig_atomic_t blockInt; -struct RemoveTempRoots -{ - ~RemoveTempRoots(); -}; - /* Exit code of the program. */ extern int exitCode; -- cgit 1.4.1