From 4f93b30192270dd7dae6f0625a02cee095abbfac Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Sun, 23 Jul 2006 17:31:35 +0000 Subject: 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 --- apps/tagcache.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'apps') diff --git a/apps/tagcache.c b/apps/tagcache.c index ba7d8b9b64..171325c679 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); } -- cgit v1.2.3