diff options
| author | Miika Pekkarinen <miipekk@ihme.org> | 2008-01-07 15:10:49 +0000 |
|---|---|---|
| committer | Miika Pekkarinen <miipekk@ihme.org> | 2008-01-07 15:10:49 +0000 |
| commit | f008da7db4327669b3e16f797cf95552490c45c6 (patch) | |
| tree | 4a59e0fad88ea3087aaf7d4992927f0633048e0b | |
| parent | f1ce964da25a6f7fc632c90fcbb222458ae9d4ee (diff) | |
| download | rockbox-f008da7db4327669b3e16f797cf95552490c45c6.zip rockbox-f008da7db4327669b3e16f797cf95552490c45c6.tar.gz rockbox-f008da7db4327669b3e16f797cf95552490c45c6.tar.bz2 rockbox-f008da7db4327669b3e16f797cf95552490c45c6.tar.xz | |
FS#8423 - Fixes quirks in routine used to remove obsolote entries from tagcache. This might fix FS#8414 and should fix FS#8384. Thanks to Lee Kang Hyuk.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16016 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/tagcache.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c index 05e2245..2b4f1a2 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -3464,11 +3464,14 @@ static bool delete_entry(long idx_id) } myidx.flag |= FLAG_DELETED; -#ifdef HAVE_TC_RAMCACHE - if (tc_stat.ramcache) - hdr->indices[idx_id].flag |= FLAG_DELETED; -#endif - + lseek(masterfd, -sizeof(struct index_entry), SEEK_CUR); + if (ecwrite(masterfd, &myidx, 1, index_entry_ec, tc_stat.econ) + != sizeof(struct index_entry)) + { + logf("delete_entry(): write_error #1"); + goto cleanup; + } + /* Now check which tags are no longer in use (if any) */ for (tag = 0; tag < TAG_COUNT; tag++) in_use[tag] = 0; @@ -3573,7 +3576,7 @@ static bool delete_entry(long idx_id) /* Delete from ram. */ if (tc_stat.ramcache && tag != tag_filename) { - struct tagfile_entry *tagentry = get_tag(&myidx, tag); + struct tagfile_entry *tagentry = (struct tagfile_entry *)&hdr->tags[tag][oldseek]; tagentry->tag_data[0] = '\0'; } #endif @@ -3609,7 +3612,7 @@ static bool delete_entry(long idx_id) if (ecwrite(masterfd, &myidx, 1, index_entry_ec, tc_stat.econ) != sizeof(struct index_entry)) { - logf("delete_entry(): write_error"); + logf("delete_entry(): write_error #2"); goto cleanup; } |