aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libmain/shared.cc10
-rw-r--r--src/libmain/shared.hh5
-rw-r--r--src/libstore/gc.cc12
-rw-r--r--src/nix-worker/nix-worker.cc2
4 files changed, 12 insertions, 17 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index 99ac198ca..d39816586 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 43725e07f..d198df70d 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;
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
index e27c63de2..95c715411 100644
--- a/src/libstore/gc.cc
+++ b/src/libstore/gc.cc
@@ -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;
diff --git a/src/nix-worker/nix-worker.cc b/src/nix-worker/nix-worker.cc
index 7ca54dee9..f5201ab6a 100644
--- a/src/nix-worker/nix-worker.cc
+++ b/src/nix-worker/nix-worker.cc
@@ -584,8 +584,6 @@ static void performOp(unsigned int clientVersion,
static void processConnection()
{
- RemoveTempRoots removeTempRoots __attribute__((unused));
-
canSendStderr = false;
myPid = getpid();
writeToStderr = tunnelStderr;