summaryrefslogtreecommitdiffstats
path: root/apps/dbtree.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dbtree.c')
-rw-r--r--apps/dbtree.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/dbtree.c b/apps/dbtree.c
index 480564d39f..5b0d325213 100644
--- a/apps/dbtree.c
+++ b/apps/dbtree.c
@@ -64,14 +64,14 @@
#define ID3DB_VERSION 2
-static int fd;
+static int fd = -1;
static int
songstart, albumstart, artiststart, filestart,
songcount, albumcount, artistcount, filecount,
songlen, songarraylen, genrelen, filelen,
albumlen, albumarraylen,
- artistlen, rundbdirty,initialized = 0;
+ artistlen, rundbdirty, initialized = 0;
static int db_play_folder(struct tree_context* c);
static int db_search(struct tree_context* c, char* string);
@@ -137,6 +137,13 @@ int db_init(void)
return 0;
}
+void db_shutdown(void)
+{
+ if (fd >= 0)
+ close(fd);
+ initialized = 0;
+}
+
int db_load(struct tree_context* c)
{
int i, offset, rc;