aboutsummaryrefslogtreecommitdiff
path: root/src/client/linux/handler/exception_handler.h
diff options
context:
space:
mode:
authornealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e>2009-02-26 21:31:53 +0000
committernealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e>2009-02-26 21:31:53 +0000
commit02c244f1b29baf8dd519a1175fb19df0cdb99a0f (patch)
tree8a8ec62fa009e807135cf3f3a5be97e5792e8720 /src/client/linux/handler/exception_handler.h
parentFix build breaks on Solaris using Sun Studio. (diff)
downloadbreakpad-02c244f1b29baf8dd519a1175fb19df0cdb99a0f.tar.xz
Fix for issue 242, plus a redo of how old exception handlers are tracked, and called.
R=Craig.Schlenter, luly81 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@315 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/linux/handler/exception_handler.h')
-rw-r--r--src/client/linux/handler/exception_handler.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/client/linux/handler/exception_handler.h b/src/client/linux/handler/exception_handler.h
index 6e6156c5..6ea09a11 100644
--- a/src/client/linux/handler/exception_handler.h
+++ b/src/client/linux/handler/exception_handler.h
@@ -36,6 +36,7 @@
#include <map>
#include <string>
+#include <signal.h>
#include <vector>
#include "client/linux/handler/minidump_generator.h"
@@ -146,6 +147,8 @@ class ExceptionHandler {
void SetupHandler(int signo);
// Teardown the handler for a signal.
void TeardownHandler(int signo);
+ // Teardown the handler for a signal.
+ void TeardownHandler(int signo, struct sigaction *old);
// Teardown all handlers.
void TeardownAllHandler();
@@ -192,10 +195,6 @@ class ExceptionHandler {
// when created (with an install_handler parameter set to true).
bool installed_handler_;
- // Keep the previous handlers for the signal.
- typedef void (*sighandler_t)(int);
- std::map<int, sighandler_t> old_handlers_;
-
// The global exception handler stack. This is need becuase there may exist
// multiple ExceptionHandler instances in a process. Each will have itself
// registered in this stack.
@@ -210,6 +209,16 @@ class ExceptionHandler {
// disallow copy ctor and operator=
explicit ExceptionHandler(const ExceptionHandler &);
void operator=(const ExceptionHandler &);
+
+ // The sigactions structure we use for each signal
+ struct sigaction act_;
+
+
+ // Keep the previous handlers for the signal.
+ // We're wasting a bit of memory here since we only change
+ // the handler for some signals but i want to avoid allocating
+ // memory in the signal handler
+ struct sigaction old_actions_[NSIG];
};
} // namespace google_breakpad