diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-07-30 17:49:04 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-07-30 17:49:04 +0000 |
commit | 63cc2e1982bd02b6484bba3fc0103c688f13711b (patch) | |
tree | 5073f3d9f857fe0162b89d34d0cf9329057f4acc /lib/Support/CrashRecoveryContext.cpp | |
parent | cdcbbfcb159eec7249734469939ea9d99d0c08dc (diff) |
Fix -Wmissing-field-initializers warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109872 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/CrashRecoveryContext.cpp')
-rw-r--r-- | lib/Support/CrashRecoveryContext.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/lib/Support/CrashRecoveryContext.cpp b/lib/Support/CrashRecoveryContext.cpp index 4514a9948d..de98132539 100644 --- a/lib/Support/CrashRecoveryContext.cpp +++ b/lib/Support/CrashRecoveryContext.cpp @@ -87,18 +87,9 @@ void CrashRecoveryContext::Disable() { #include <signal.h> -static struct { - int Signal; - struct sigaction PrevAction; -} SignalInfo[] = { - { SIGABRT, {} }, - { SIGBUS, {} }, - { SIGFPE, {} }, - { SIGILL, {} }, - { SIGSEGV, {} }, - { SIGTRAP, {} }, -}; -static const unsigned NumSignals = sizeof(SignalInfo) / sizeof(SignalInfo[0]); +static int Signals[] = { SIGABRT, SIGBUS, SIGFPE, SIGILL, SIGSEGV, SIGTRAP }; +static const unsigned NumSignals = sizeof(Signals) / sizeof(Signals[0]); +static struct sigaction PrevActions[NumSignals]; static void CrashRecoverySignalHandler(int Signal) { // Lookup the current thread local recovery object. @@ -142,8 +133,7 @@ void CrashRecoveryContext::Enable() { sigemptyset(&Handler.sa_mask); for (unsigned i = 0; i != NumSignals; ++i) { - sigaction(SignalInfo[i].Signal, &Handler, - &SignalInfo[i].PrevAction); + sigaction(Signals[i], &Handler, &PrevActions[i]); } } @@ -155,7 +145,7 @@ void CrashRecoveryContext::Disable() { // Restore the previous signal handlers. for (unsigned i = 0; i != NumSignals; ++i) - sigaction(SignalInfo[i].Signal, &SignalInfo[i].PrevAction, 0); + sigaction(Signals[i], &PrevActions[i], 0); } #endif |