From 43863a70c87c80e3a15315f561c3a247b27c81fa Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 18 Oct 2013 08:44:40 +0200 Subject: SignalMonitor: add SignalMonitorGetEventLoop() Eliminate the global variable "shutdown_loop". --- src/SignalHandlers.cxx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/SignalHandlers.cxx') diff --git a/src/SignalHandlers.cxx b/src/SignalHandlers.cxx index c884b97fd..b18fce0fa 100644 --- a/src/SignalHandlers.cxx +++ b/src/SignalHandlers.cxx @@ -25,9 +25,7 @@ #include "Log.hxx" #include "LogInit.hxx" -#include "Main.hxx" #include "event/Loop.hxx" -#include "GlobalEvents.hxx" #include "system/FatalError.hxx" #include "util/Domain.hxx" @@ -35,12 +33,10 @@ static constexpr Domain signal_handlers_domain("signal_handlers"); -static EventLoop *shutdown_loop; - static void HandleShutdownSignal() { - shutdown_loop->Break(); + SignalMonitorGetEventLoop().Break(); } static void @@ -72,7 +68,6 @@ SignalHandlersInit(EventLoop &loop) sa.sa_handler = SIG_IGN; x_sigaction(SIGPIPE, &sa); - shutdown_loop = &loop; SignalMonitorRegister(SIGINT, HandleShutdownSignal); SignalMonitorRegister(SIGTERM, HandleShutdownSignal); -- cgit v1.2.3