diff --git a/src/Listen.cxx b/src/Listen.cxx index 6cee115f2..b74777127 100644 --- a/src/Listen.cxx +++ b/src/Listen.cxx @@ -21,7 +21,7 @@ #include "Listen.hxx" #include "client/Listener.hxx" #include "config/Param.hxx" -#include "config/Global.hxx" +#include "config/Data.hxx" #include "config/Option.hxx" #include "system/Error.hxx" #include "util/RuntimeError.hxx" @@ -79,16 +79,16 @@ listen_systemd_activation(ClientListener &listener) #endif void -listen_global_init(ClientListener &listener) +listen_global_init(const ConfigData &config, ClientListener &listener) { - int port = config_get_positive(ConfigOption::PORT, DEFAULT_PORT); + int port = config.GetPositive(ConfigOption::PORT, DEFAULT_PORT); #ifdef ENABLE_SYSTEMD_DAEMON if (listen_systemd_activation(listener)) return; #endif - for (const auto *param = config_get_param(ConfigOption::BIND_TO_ADDRESS); + for (const auto *param = config.GetParam(ConfigOption::BIND_TO_ADDRESS); param != nullptr; param = param->next) { try { listen_add_config_param(listener, port, param); diff --git a/src/Listen.hxx b/src/Listen.hxx index c5d2ebbb8..620aafdd2 100644 --- a/src/Listen.hxx +++ b/src/Listen.hxx @@ -20,11 +20,12 @@ #ifndef MPD_LISTEN_HXX #define MPD_LISTEN_HXX +struct ConfigData; class ClientListener; extern int listen_port; void -listen_global_init(ClientListener &listener); +listen_global_init(const ConfigData &config, ClientListener &listener); #endif diff --git a/src/Main.cxx b/src/Main.cxx index 4bce50b3d..818b1bddf 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -530,7 +530,7 @@ try { initialize_decoder_and_player(raw_config, config.replay_gain); - listen_global_init(*instance->partitions.front().listener); + listen_global_init(raw_config, *instance->partitions.front().listener); #ifdef ENABLE_DAEMON daemonize_set_user();