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

Unified Diff: runtime/vm/signal_handler_linux.cc

Issue 1061033005: Remove profiler signal handler on shutdown (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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
Index: runtime/vm/signal_handler_linux.cc
diff --git a/runtime/vm/signal_handler_linux.cc b/runtime/vm/signal_handler_linux.cc
index 957edda62bc2b5b46b0d0d7e4651f6898a51b554..960b417fc3717b1b2ee1196c8dabb763bf3214e5 100644
--- a/runtime/vm/signal_handler_linux.cc
+++ b/runtime/vm/signal_handler_linux.cc
@@ -129,9 +129,19 @@ void SignalHandler::Install(SignalAction action) {
act.sa_sigaction = action;
sigemptyset(&act.sa_mask);
act.sa_flags = SA_RESTART | SA_SIGINFO;
- // TODO(johnmccutchan): Do we care about restoring the signal handler?
- struct sigaction old_act;
- int r = sigaction(SIGPROF, &act, &old_act);
+ int r = sigaction(SIGPROF, &act, NULL);
+ ASSERT(r == 0);
+}
+
+
+void SignalHandler::Remove() {
+ // Ignore future SIGPROF signals because by default SIGPROF will terminate
+ // the process and we may have some signals in flight.
+ struct sigaction act;
+ act.sa_handler = SIG_IGN;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = 0;
+ int r = sigaction(SIGPROF, &act, NULL);
ASSERT(r == 0);
}

Powered by Google App Engine
This is Rietveld 408576698