From 8ab29541b933d328d9cd4c73ade8475a22e361a2 Mon Sep 17 00:00:00 2001 From: Adam Wardynski <award@.(win7-laptop)> Date: Sat, 13 Nov 2010 21:37:20 +0100 Subject: [PATCH] If SIGUSR1 is not defined, skip the code that registers handler for TokenTimer (so yes, it is not fully functional on a system without SIGUSR1). --- libcorpus2/util/tokentimer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libcorpus2/util/tokentimer.cpp b/libcorpus2/util/tokentimer.cpp index 293dcf5..4c2d948 100644 --- a/libcorpus2/util/tokentimer.cpp +++ b/libcorpus2/util/tokentimer.cpp @@ -56,10 +56,13 @@ namespace { void TokenTimer::register_signal_handler() { +#ifdef SIGUSR1 struct sigaction s; memset(&s, 0, sizeof(s)); s.sa_handler = &handler; - if (sigaction(SIGUSR1, &s, 0) != 0) { + if (sigaction(SIGUSR1, &s, 0) != 0) +#endif + { std::cerr << "Signal handler registration error\n"; } } -- GitLab