AU: Catch terminate signals and block exit if necessary.
Adds a global Terminator class to manage signals and exit blocking.
BUG=7392
TEST=unit tests, gmerged on device, initctl stop update-engine
Change-Id: I2291d4eb55240a6662b18ff834af161d957bce2f
Review URL: http://codereview.chromium.org/3608015
diff --git a/testrunner.cc b/testrunner.cc
index 3e40e1f..748dd5f 100644
--- a/testrunner.cc
+++ b/testrunner.cc
@@ -4,21 +4,24 @@
// based on pam_google_testrunner.cc
+#include <base/at_exit.h>
+#include <base/command_line.h>
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-bindings.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <glib.h>
#include <glib-object.h>
#include <gtest/gtest.h>
-#include "base/at_exit.h"
-#include "base/command_line.h"
+
#include "update_engine/subprocess.h"
+#include "update_engine/terminator.h"
int main(int argc, char **argv) {
::g_type_init();
g_thread_init(NULL);
dbus_g_thread_init();
base::AtExitManager exit_manager;
+ chromeos_update_engine::Terminator::Init();
chromeos_update_engine::Subprocess::Init();
CommandLine::Init(argc, argv);
::testing::InitGoogleTest(&argc, argv);