diff options
author | Max Kellermann <max@duempel.org> | 2014-02-17 21:42:58 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-17 22:13:53 +0100 |
commit | 3af7af0b8fe603ab5c45f2cf3d89cb6ca017c40e (patch) | |
tree | a90f4a53cb74935640dd24efed39b91a34a9595e /src/Main.cxx | |
parent | 1ddd00433ee4eb60818e8bd587d6f3ccfec70b8f (diff) | |
download | mpd-3af7af0b8fe603ab5c45f2cf3d89cb6ca017c40e.tar.gz mpd-3af7af0b8fe603ab5c45f2cf3d89cb6ca017c40e.tar.xz mpd-3af7af0b8fe603ab5c45f2cf3d89cb6ca017c40e.zip |
Main: move code to InitDatabaseAndStorage()
Diffstat (limited to 'src/Main.cxx')
-rw-r--r-- | src/Main.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/Main.cxx b/src/Main.cxx index 69e148700..23f1659d7 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -196,6 +196,17 @@ glue_db_init_and_load(void) 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 /** @@ -445,12 +456,7 @@ int mpd_main(int argc, char *argv[]) decoder_plugin_init_all(); #ifdef ENABLE_DATABASE - if (!InitStorage(error)) { - LogError(error); - return EXIT_FAILURE; - } - - const bool create_db = !glue_db_init_and_load(); + const bool create_db = InitDatabaseAndStorage(); #endif glue_sticker_init(); |