aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-03-02 15:42:21 +0100
committerMax Kellermann <max@duempel.org>2009-03-02 15:42:21 +0100
commitc0ffec2fd1add50dae44c9e73a3c47d7d3998d15 (patch)
treeb08b5949ba8274139f358c61dd0a3071035ac1a8 /src/main.c
parenteb5b3ce553cc7de68235c65863651a52283c2fe1 (diff)
downloadmpd-c0ffec2fd1add50dae44c9e73a3c47d7d3998d15.tar.gz
mpd-c0ffec2fd1add50dae44c9e73a3c47d7d3998d15.tar.xz
mpd-c0ffec2fd1add50dae44c9e73a3c47d7d3998d15.zip
database: db_load() returns GError
Do error reporting with GLib's GError library.
Diffstat (limited to '')
-rw-r--r--src/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 1b84f68b9..cad9e5904 100644
--- a/src/main.c
+++ b/src/main.c
@@ -94,6 +94,7 @@ openDB(const Options *options)
{
const char *path = config_get_path(CONF_DB_FILE);
bool ret;
+ GError *error = NULL;
if (!mapper_has_music_directory()) {
if (path != NULL)
@@ -112,8 +113,11 @@ openDB(const Options *options)
/* don't attempt to load the old database */
return false;
- ret = db_load();
+ ret = db_load(&error);
if (!ret) {
+ g_warning("Failed to load database: %s", error->message);
+ g_error_free(error);
+
if (options->createDB < 0)
g_error("can't open db file and using "
"\"--no-create-db\" command line option");