summaryrefslogtreecommitdiffstats
path: root/tests/ScopedSignalHandler.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ScopedSignalHandler.h')
-rw-r--r--tests/ScopedSignalHandler.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/ScopedSignalHandler.h b/tests/ScopedSignalHandler.h
index 89a14a6..3ec23b0 100644
--- a/tests/ScopedSignalHandler.h
+++ b/tests/ScopedSignalHandler.h
@@ -21,9 +21,10 @@
class ScopedSignalHandler {
public:
- ScopedSignalHandler(int signal_number, void (*handler)(int)) : signal_number_(signal_number) {
+ ScopedSignalHandler(int signal_number, void (*handler)(int), int sa_flags = 0)
+ : signal_number_(signal_number) {
sigemptyset(&action_.sa_mask);
- action_.sa_flags = 0;
+ action_.sa_flags = sa_flags;
action_.sa_handler = handler;
sigaction(signal_number_, &action_, &old_action_);
}