summaryrefslogtreecommitdiff
path: root/test/ShutdownHandler.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'test/ShutdownHandler.cxx')
-rw-r--r--test/ShutdownHandler.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/ShutdownHandler.cxx b/test/ShutdownHandler.cxx
index ce8b9f7b3..2f6cdc39d 100644
--- a/test/ShutdownHandler.cxx
+++ b/test/ShutdownHandler.cxx
@@ -27,17 +27,18 @@
#include <signal.h>
static void
-HandleShutdownSignal()
+HandleShutdownSignal(void *ctx)
{
- SignalMonitorGetEventLoop().Break();
+ auto &loop = *(EventLoop *)ctx;
+ loop.Break();
}
ShutdownHandler::ShutdownHandler(EventLoop &loop)
{
SignalMonitorInit(loop);
- SignalMonitorRegister(SIGINT, HandleShutdownSignal);
- SignalMonitorRegister(SIGTERM, HandleShutdownSignal);
+ SignalMonitorRegister(SIGINT, {&loop, HandleShutdownSignal});
+ SignalMonitorRegister(SIGTERM, {&loop, HandleShutdownSignal});
}
ShutdownHandler::~ShutdownHandler()