aboutsummaryrefslogtreecommitdiffstats
path: root/src/SignalHandlers.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-18 08:44:40 +0200
committerMax Kellermann <max@duempel.org>2013-10-18 08:44:40 +0200
commit43863a70c87c80e3a15315f561c3a247b27c81fa (patch)
treef75f3e2590225876cae799fe7b930b4d92a43c02 /src/SignalHandlers.cxx
parentbd5a70c71285265e59685b7b55cf31069785a58f (diff)
downloadmpd-43863a70c87c80e3a15315f561c3a247b27c81fa.tar.gz
mpd-43863a70c87c80e3a15315f561c3a247b27c81fa.tar.xz
mpd-43863a70c87c80e3a15315f561c3a247b27c81fa.zip
SignalMonitor: add SignalMonitorGetEventLoop()
Eliminate the global variable "shutdown_loop".
Diffstat (limited to 'src/SignalHandlers.cxx')
-rw-r--r--src/SignalHandlers.cxx7
1 files changed, 1 insertions, 6 deletions
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);