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

Unified Diff: lib/Support/Unix/Signals.inc

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 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 | « lib/Support/Unix/Program.inc ('k') | lib/Support/Unix/TimeValue.inc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Support/Unix/Signals.inc
diff --git a/lib/Support/Unix/Signals.inc b/lib/Support/Unix/Signals.inc
index e8f4643dc8a761c93d9188d42809f9e7135fd208..fc12331c4153f559c6f1e8951dec5c2ce2437396 100644
--- a/lib/Support/Unix/Signals.inc
+++ b/lib/Support/Unix/Signals.inc
@@ -93,6 +93,7 @@ static struct {
static void RegisterHandler(int Signal) {
+#if !defined(__native_client__)
assert(NumRegisteredSignals <
sizeof(RegisteredSignalInfo)/sizeof(RegisteredSignalInfo[0]) &&
"Out of space for signal handlers!");
@@ -108,6 +109,7 @@ static void RegisterHandler(int Signal) {
&RegisteredSignalInfo[NumRegisteredSignals].SA);
RegisteredSignalInfo[NumRegisteredSignals].SigNo = Signal;
++NumRegisteredSignals;
+#endif // (__native_client__)
}
static void RegisterHandlers() {
@@ -119,11 +121,13 @@ static void RegisterHandlers() {
}
static void UnregisterHandlers() {
+#if !defined(__native_client__)
// Restore all of the signal handlers to how they were before we showed up.
for (unsigned i = 0, e = NumRegisteredSignals; i != e; ++i)
sigaction(RegisteredSignalInfo[i].SigNo,
&RegisteredSignalInfo[i].SA, nullptr);
NumRegisteredSignals = 0;
+#endif // (__native_client__)
}
@@ -167,10 +171,12 @@ static RETSIGTYPE SignalHandler(int Sig) {
// instead of recursing in the signal handler.
UnregisterHandlers();
+#if !defined(__native_client__)
// Unmask all potentially blocked kill signals.
sigset_t SigMask;
sigfillset(&SigMask);
sigprocmask(SIG_UNBLOCK, &SigMask, nullptr);
+#endif
{
unique_lock<SmartMutex<true>> Guard(*SignalsMutex);
« no previous file with comments | « lib/Support/Unix/Program.inc ('k') | lib/Support/Unix/TimeValue.inc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698