summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-07-23 17:31:35 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-07-23 17:31:35 +0000
commit4f93b30192270dd7dae6f0625a02cee095abbfac (patch)
treec9c1188571a0b8ac317b33cf99ef9dd929efb7bd
parent8eba20aefe024eb2b334e1d77b542c4ff1862300 (diff)
downloadrockbox-4f93b30192270dd7dae6f0625a02cee095abbfac.zip
rockbox-4f93b30192270dd7dae6f0625a02cee095abbfac.tar.gz
rockbox-4f93b30192270dd7dae6f0625a02cee095abbfac.tar.bz2
rockbox-4f93b30192270dd7dae6f0625a02cee095abbfac.tar.xz
Don't write ram flags to disk (causes internal error).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10297 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/tagcache.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index ba7d8b9..171325c 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -460,6 +460,9 @@ static bool write_index(int masterfd, int idxid, struct index_entry *idx)
memcpy(&hdr->indices[idxid], idx, sizeof(struct index_entry));
#endif
+ /* We need to exclude all memory only flags when writing on disk. */
+ idx->flag = idx->flag & ~(FLAG_DIRCACHE);
+
lseek(masterfd, idxid * sizeof(struct index_entry)
+ sizeof(struct master_header), SEEK_SET);
if (write(masterfd, idx, sizeof(struct index_entry)) !=
@@ -3104,7 +3107,12 @@ static void load_ramcache(void)
stat.ramcache = load_tagcache();
if (!stat.ramcache)
+ {
+ /* If loading failed, it must indicate some problem with the db
+ * so disable it entirely to prevent further issues. */
+ stat.ready = false;
hdr = NULL;
+ }
cpu_boost(false);
}