summaryrefslogtreecommitdiff
path: root/apps/tagcache.c
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2010-07-18 18:17:47 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2010-07-18 18:17:47 +0000
commit17d2edf1d22245f96038898d0080b670d8ec125e (patch)
treecd190b48b971378e3d527c455eb2c95010573231 /apps/tagcache.c
parent7d4414ebd8ba8bb79359a72ccd7d0b71fdb0fd36 (diff)
downloadrockbox-17d2edf1d22245f96038898d0080b670d8ec125e.zip
rockbox-17d2edf1d22245f96038898d0080b670d8ec125e.tar.gz
rockbox-17d2edf1d22245f96038898d0080b670d8ec125e.tar.bz2
rockbox-17d2edf1d22245f96038898d0080b670d8ec125e.tar.xz
Properly initialize tagcache headers when doing commit() during
boot-up. Should fix "Recently added" entries remaining empty when dircache is not used nor database is loaded to ram. Also, don't load load hibernated statefile on H1xx targets when database loading to ram has been disabled explicitly. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27484 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tagcache.c')
-rw-r--r--apps/tagcache.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index 822a848..1094c92 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -2858,7 +2858,7 @@ static bool commit(void)
if (tch.magic != TAGCACHE_MAGIC || rc != len)
{
- logf("incorrect header");
+ logf("incorrect tmpheader");
close(tmpfd);
remove(TAGCACHE_FILE_TEMP);
return false;
@@ -2872,6 +2872,9 @@ static bool commit(void)
return true;
}
+ /* Fully initialize existing headers (if any) before going further. */
+ tc_stat.ready = check_all_headers();
+
#ifdef HAVE_EEPROM_SETTINGS
remove(TAGCACHE_STATEFILE);
#endif
@@ -4361,8 +4364,11 @@ static void tagcache_thread(void)
#ifdef HAVE_TC_RAMCACHE
# ifdef HAVE_EEPROM_SETTINGS
- if (firmware_settings.initialized && firmware_settings.disk_clean)
+ if (firmware_settings.initialized && firmware_settings.disk_clean
+ && global_settings.tagcache_ram)
+ {
check_done = tagcache_dumpload();
+ }
remove(TAGCACHE_STATEFILE);
# endif
@@ -4376,9 +4382,12 @@ static void tagcache_thread(void)
tc_stat.initialized = true;
/* Don't delay bootup with the header check but do it on background. */
- sleep(HZ);
- tc_stat.ready = check_all_headers();
- tc_stat.readyvalid = true;
+ if (!tc_stat.ready)
+ {
+ sleep(HZ);
+ tc_stat.ready = check_all_headers();
+ tc_stat.readyvalid = true;
+ }
while (1)
{