diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-07-02 10:50:42 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-07-02 10:50:42 +0000 |
commit | 8102f3da270ce5a442523a1738318493906bb86a (patch) | |
tree | 84ead8106d88ff86ec8f1887c5e88d9d7be41a5d /apps/database.c | |
parent | a077b9ef12c480ddd7845af5e7da6ffd22e8464d (diff) | |
download | rockbox-8102f3da270ce5a442523a1738318493906bb86a.tar.gz rockbox-8102f3da270ce5a442523a1738318493906bb86a.zip |
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
Diffstat (limited to 'apps/database.c')
-rw-r--r-- | apps/database.c | 10 |
1 files changed, 10 insertions, 0 deletions
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) | |||
315 | #endif | 315 | #endif |
316 | if(!tagdb_initialized) /* forget it.*/ | 316 | if(!tagdb_initialized) /* forget it.*/ |
317 | return -1; | 317 | return -1; |
318 | |||
319 | if(!global_settings.runtimedb) /* user doesn't care */ | ||
320 | return -1; | ||
318 | 321 | ||
319 | rundb_fd = open(ROCKBOX_DIR "/rockbox.rundb", O_CREAT|O_RDWR); | 322 | rundb_fd = open(ROCKBOX_DIR "/rockbox.rundb", O_CREAT|O_RDWR); |
320 | if (rundb_fd < 0) { | 323 | if (rundb_fd < 0) { |
@@ -358,6 +361,13 @@ int rundb_init(void) | |||
358 | #endif | 361 | #endif |
359 | } | 362 | } |
360 | 363 | ||
364 | void rundb_shutdown(void) | ||
365 | { | ||
366 | if (rundb_fd >= 0) | ||
367 | close(rundb_fd); | ||
368 | rundb_initialized = 0; | ||
369 | } | ||
370 | |||
361 | void writerundbheader(void) | 371 | void writerundbheader(void) |
362 | { | 372 | { |
363 | lseek(rundb_fd,0,SEEK_SET); | 373 | lseek(rundb_fd,0,SEEK_SET); |