From 29d05cdb8ecde61ba04cbd8c67c11dd4e76abd53 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 17 Feb 2020 12:12:38 +0100 Subject: [PATCH] unix/SignalHandlers: pass Instance to ...Init() --- src/Main.cxx | 2 +- src/unix/SignalHandlers.cxx | 6 ++++-- src/unix/SignalHandlers.hxx | 8 ++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Main.cxx b/src/Main.cxx index 0c20fb6cd..8b9692812 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -464,7 +464,7 @@ MainConfigured(const struct options &options, const ConfigData &raw_config) #ifndef ANDROID setup_log_output(); - const ScopeSignalHandlersInit signal_handlers_init(instance.event_loop); + const ScopeSignalHandlersInit signal_handlers_init(instance); #endif instance.io_thread.Start(); diff --git a/src/unix/SignalHandlers.cxx b/src/unix/SignalHandlers.cxx index 57e3b4a08..873025ec0 100644 --- a/src/unix/SignalHandlers.cxx +++ b/src/unix/SignalHandlers.cxx @@ -18,13 +18,13 @@ */ #include "SignalHandlers.hxx" +#include "Instance.hxx" #include "event/SignalMonitor.hxx" #ifndef _WIN32 #include "Log.hxx" #include "LogInit.hxx" -#include "event/Loop.hxx" #include "system/Error.hxx" #include "util/Domain.hxx" @@ -56,8 +56,10 @@ handle_reload_event(void *) noexcept #endif void -SignalHandlersInit(EventLoop &loop) +SignalHandlersInit(Instance &instance) { + auto &loop = instance.event_loop; + SignalMonitorInit(loop); #ifndef _WIN32 diff --git a/src/unix/SignalHandlers.hxx b/src/unix/SignalHandlers.hxx index 6dcd648bf..8e1b26c92 100644 --- a/src/unix/SignalHandlers.hxx +++ b/src/unix/SignalHandlers.hxx @@ -20,18 +20,18 @@ #ifndef MPD_SIGNAL_HANDLERS_HXX #define MPD_SIGNAL_HANDLERS_HXX -class EventLoop; +struct Instance; void -SignalHandlersInit(EventLoop &loop); +SignalHandlersInit(Instance &instance); void SignalHandlersFinish() noexcept; class ScopeSignalHandlersInit { public: - ScopeSignalHandlersInit(EventLoop &loop) { - SignalHandlersInit(loop); + ScopeSignalHandlersInit(Instance &instance) { + SignalHandlersInit(instance); } ~ScopeSignalHandlersInit() noexcept {