Commit 3af7af0b authored by Max Kellermann's avatar Max Kellermann

Main: move code to InitDatabaseAndStorage()

parent 1ddd0043
...@@ -196,6 +196,17 @@ glue_db_init_and_load(void) ...@@ -196,6 +196,17 @@ glue_db_init_and_load(void)
return db.FileExists(); return db.FileExists();
} }
static bool
InitDatabaseAndStorage()
{
Error error;
if (!InitStorage(error))
FatalError(error);
const bool create_db = !glue_db_init_and_load();
return create_db;
}
#endif #endif
/** /**
...@@ -445,12 +456,7 @@ int mpd_main(int argc, char *argv[]) ...@@ -445,12 +456,7 @@ int mpd_main(int argc, char *argv[])
decoder_plugin_init_all(); decoder_plugin_init_all();
#ifdef ENABLE_DATABASE #ifdef ENABLE_DATABASE
if (!InitStorage(error)) { const bool create_db = InitDatabaseAndStorage();
LogError(error);
return EXIT_FAILURE;
}
const bool create_db = !glue_db_init_and_load();
#endif #endif
glue_sticker_init(); glue_sticker_init();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment