summaryrefslogtreecommitdiff
path: root/src/signalhandler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/signalhandler.cc')
-rw-r--r--src/signalhandler.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/signalhandler.cc b/src/signalhandler.cc
index d6c203b..cccd800 100644
--- a/src/signalhandler.cc
+++ b/src/signalhandler.cc
@@ -48,6 +48,9 @@
_START_GOOGLE_NAMESPACE_
+// TOOD(hamaji): Use signal instead of sigaction?
+#ifdef HAVE_SIGACTION
+
namespace {
// We'll install the failure signal handler for these signals. We could
@@ -330,7 +333,10 @@ void FailureSignalHandler(int signal_number,
} // namespace
+#endif // HAVE_SIGACTION
+
void InstallFailureSignalHandler() {
+#ifdef HAVE_SIGACTION
// Build the sigaction struct.
struct sigaction sig_action;
memset(&sig_action, 0, sizeof(sig_action));
@@ -341,10 +347,13 @@ void InstallFailureSignalHandler() {
for (size_t i = 0; i < ARRAYSIZE(kFailureSignals); ++i) {
CHECK_ERR(sigaction(kFailureSignals[i].number, &sig_action, NULL));
}
+#endif // HAVE_SIGACTION
}
void InstallFailureWriter(void (*writer)(const char* data, int size)) {
+#ifdef HAVE_SIGACTION
g_failure_writer = writer;
+#endif // HAVE_SIGACTION
}
_END_GOOGLE_NAMESPACE_