From 8102f3da270ce5a442523a1738318493906bb86a Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sat, 2 Jul 2005 10:50:42 +0000 Subject: New option to enable/disable the runtime database. Moved the runtimedb init to a more appropriate place and added proper USB handling. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6984 a1c6a512-1295-4272-9138-f99709370657 --- apps/database.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'apps/database.c') diff --git a/apps/database.c b/apps/database.c index bce1fb44cd..ad97b55ee7 100644 --- a/apps/database.c +++ b/apps/database.c @@ -315,6 +315,9 @@ int rundb_init(void) #endif if(!tagdb_initialized) /* forget it.*/ return -1; + + if(!global_settings.runtimedb) /* user doesn't care */ + return -1; rundb_fd = open(ROCKBOX_DIR "/rockbox.rundb", O_CREAT|O_RDWR); if (rundb_fd < 0) { @@ -358,6 +361,13 @@ int rundb_init(void) #endif } +void rundb_shutdown(void) +{ + if (rundb_fd >= 0) + close(rundb_fd); + rundb_initialized = 0; +} + void writerundbheader(void) { lseek(rundb_fd,0,SEEK_SET); -- cgit v1.2.3