summaryrefslogtreecommitdiff
path: root/src/Main.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-12-10 00:00:50 +0100
committerMax Kellermann <max@musicpd.org>2016-12-10 00:00:50 +0100
commitd2a1294e9afafb1880db3eb382a958b08065e719 (patch)
tree0884af1cbeaca3730ca1bdd30067c18fcc19f401 /src/Main.cxx
parent3d897f18cdd6924d011be6f59517ffeefce0cf52 (diff)
Main: add struct Config, empty currently
Diffstat (limited to 'src/Main.cxx')
-rw-r--r--src/Main.cxx22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index d2c2db504..3f3acf280 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -127,6 +127,16 @@ Context *context;
Instance *instance;
+struct Config {
+};
+
+gcc_const
+static Config
+LoadConfig()
+{
+ return {};
+}
+
#ifdef ENABLE_DAEMON
static void
@@ -383,7 +393,7 @@ int main(int argc, char *argv[])
#endif
static int
-mpd_main_after_fork();
+mpd_main_after_fork(const Config &config);
#ifdef ANDROID
static inline
@@ -425,6 +435,8 @@ try {
ParseCommandLine(argc, argv, &options);
#endif
+ const auto config = LoadConfig();
+
#ifdef ENABLE_DAEMON
glue_daemonize_init(&options);
#endif
@@ -468,12 +480,12 @@ try {
This must be run after forking; if dispatch is called before forking,
the child process will have a broken internal dispatch state. */
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
- exit(mpd_main_after_fork());
+ exit(mpd_main_after_fork(config));
});
dispatch_main();
return EXIT_FAILURE; // unreachable, because dispatch_main never returns
#else
- return mpd_main_after_fork();
+ return mpd_main_after_fork(config);
#endif
} catch (const std::exception &e) {
LogError(e);
@@ -481,8 +493,10 @@ try {
}
static int
-mpd_main_after_fork()
+mpd_main_after_fork(const Config &config)
try {
+ (void)config;
+
ConfigureFS();
glue_mapper_init();