Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Unified Diff: chrome/app/mash/mash_runner.cc

Issue 2731283008: chromeos/mash: Reset signal handler mask on chrome --mash startup (Closed)
Patch Set: add comment with bug number Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/mash/mash_runner.cc
diff --git a/chrome/app/mash/mash_runner.cc b/chrome/app/mash/mash_runner.cc
index f6be9d7d6d7b286a40669462b487c76e9bbd7322..d4e181a31de0faee2064b85a27b9dafbc225ffcd 100644
--- a/chrome/app/mash/mash_runner.cc
+++ b/chrome/app/mash/mash_runner.cc
@@ -57,9 +57,11 @@
#include "ui/base/ui_base_switches.h"
#if defined(OS_POSIX)
+#include <signal.h>
+
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/app/shutdown_signal_handlers_posix.h"
-#endif
+#endif // defined(OS_POSIX)
using service_manager::mojom::ServiceFactory;
@@ -260,6 +262,16 @@ int MashMain() {
#if !defined(OFFICIAL_BUILD) && defined(OS_WIN)
base::RouteStdioToConsole(false);
#endif
+
+#if defined(OS_POSIX)
+ // We inherit the signal mask of our parent process, which might block signals
+ // like SIGTERM that we need in order to cleanly shut down. Reset the signal
+ // mask to unblock all signals. http://crbug.com/699777
+ sigset_t empty_signal_set;
+ CHECK_EQ(0, sigemptyset(&empty_signal_set));
+ CHECK_EQ(0, sigprocmask(SIG_SETMASK, &empty_signal_set, nullptr));
+#endif
+
// TODO(sky): wire this up correctly.
service_manager::InitializeLogging();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698