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 | c90e82a7f14a0f1b289f81fae08f4c4629c5d569 (patch) | |
tree | bce1383a6d70b5158db53004fed67f07450a4e14 /llvm/lib/Support/CrashRecoveryContext.cpp | |
parent | 671eee9e6873bebb0925ff695c7b66b874f72fd2 (diff) | |
download | llvm-c90e82a7f14a0f1b289f81fae08f4c4629c5d569.zip llvm-c90e82a7f14a0f1b289f81fae08f4c4629c5d569.tar.gz llvm-c90e82a7f14a0f1b289f81fae08f4c4629c5d569.tar.bz2 |
Fix -Wmissing-field-initializers warnings.
llvm-svn: 109872
Diffstat (limited to 'llvm/lib/Support/CrashRecoveryContext.cpp')
-rw-r--r-- | llvm/lib/Support/CrashRecoveryContext.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/llvm/lib/Support/CrashRecoveryContext.cpp b/llvm/lib/Support/CrashRecoveryContext.cpp index 4514a99..de98132 100644 --- a/llvm/lib/Support/CrashRecoveryContext.cpp +++ b/llvm/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 |