diff options
author | Max Kellermann <max@duempel.org> | 2009-01-18 17:54:46 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-18 17:54:46 +0100 |
commit | 9c6b2a32f510778252f3a9c79725334aaec4d80b (patch) | |
tree | 84be4ae5ca15520ef686bbfbaa0bb9787c640247 /src/main.c | |
parent | a3f03f3ccdefc8704d112405dca5db10a2f6cf94 (diff) | |
download | mpd-9c6b2a32f510778252f3a9c79725334aaec4d80b.tar.gz mpd-9c6b2a32f510778252f3a9c79725334aaec4d80b.tar.xz mpd-9c6b2a32f510778252f3a9c79725334aaec4d80b.zip |
conf: added config_get_path()
config_get_path() is an simpler interface than parseConfigFilePath().
Diffstat (limited to '')
-rw-r--r-- | src/main.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c index 9b1203a92..c7f9e9987 100644 --- a/src/main.c +++ b/src/main.c @@ -81,19 +81,20 @@ struct notify main_notify; static void openDB(Options * options, char *argv0) { - struct config_param *param; + const char *path = config_get_path(CONF_DB_FILE); - param = parseConfigFilePath(CONF_DB_FILE, - mapper_has_music_directory()); if (!mapper_has_music_directory()) { - if (param != NULL) + if (path != NULL) g_message("Found " CONF_DB_FILE " setting without " CONF_MUSIC_DIR " - disabling database"); db_init(NULL); return; } - db_init(param->value); + if (path == NULL) + g_error(CONF_DB_FILE " setting missing"); + + db_init(path); if (options->createDB > 0 || !db_load()) { unsigned job; |