aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-04 21:18:16 +0100
committerMax Kellermann <max@duempel.org>2009-01-04 21:18:16 +0100
commit82166b715c2e8b39eb20d179c95aa982335ad07c (patch)
tree2a66426ae0db1fede2649d61f465ba20f1830812 /src/main.c
parent6acba7350938c099afab7bec04c8dc9adf674424 (diff)
downloadmpd-82166b715c2e8b39eb20d179c95aa982335ad07c.tar.gz
mpd-82166b715c2e8b39eb20d179c95aa982335ad07c.tar.xz
mpd-82166b715c2e8b39eb20d179c95aa982335ad07c.zip
database: db_init() initializes library, does not update
For updating the database, directory_update_init() should be called explicitly.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index d0573e9b3..bd00d4007 100644
--- a/src/main.c
+++ b/src/main.c
@@ -126,7 +126,11 @@ static void changeToUser(void)
static void openDB(Options * options, char *argv0)
{
+ db_init();
+
if (options->createDB > 0 || db_load() < 0) {
+ unsigned job;
+
if (options->createDB < 0) {
g_error("can't open db file and using "
"\"--no-create-db\" command line option; "
@@ -134,7 +138,12 @@ static void openDB(Options * options, char *argv0)
}
if (db_check() < 0)
exit(EXIT_FAILURE);
- db_init();
+
+ db_clear();
+
+ job = directory_update_init(NULL);
+ if (job == 0)
+ g_error("directory update failed");
}
}