Index: apps/tree.c =================================================================== --- apps/tree.c (revisione 29907) +++ apps/tree.c (copia locale) @@ -1180,8 +1180,8 @@ global_status.dircache_size = dircache_get_cache_size(); # ifdef HAVE_EEPROM_SETTINGS if (firmware_settings.initialized) +# endif dircache_save(); -# endif dircache_disable(); } else Index: apps/main.c =================================================================== --- apps/main.c (revisione 29907) +++ apps/main.c (copia locale) @@ -209,15 +209,19 @@ if (!global_settings.dircache) return 0; + if ( # ifdef HAVE_EEPROM_SETTINGS - if (firmware_settings.initialized && firmware_settings.disk_clean - && preinit) + firmware_settings.initialized && firmware_settings.disk_clean && +# endif + preinit) { result = dircache_load(); if (result < 0) { +# ifdef HAVE_EEPROM_SETTINGS firmware_settings.disk_clean = false; +# endif if (global_status.dircache_size <= 0) { /* This will be in default language, settings are not @@ -230,7 +234,6 @@ } } else -# endif { if (preinit) return -1; Index: firmware/common/dircache.c =================================================================== --- firmware/common/dircache.c (revisione 29907) +++ firmware/common/dircache.c (copia locale) @@ -83,7 +83,6 @@ /* --- Internal cache structure control functions --- */ -#ifdef HAVE_EEPROM_SETTINGS /** * Open the dircache file to save a snapshot on disk */ @@ -102,7 +101,7 @@ { return remove(DIRCACHE_FILE); } -#endif + /** * Internal function to allocate a new dircache_entry from memory. */ @@ -495,7 +494,6 @@ return at_root ? NULL : cache_entry; } -#ifdef HAVE_EEPROM_SETTINGS /** * Function to load the internal cache structure from disk to initialize * the dircache really fast and little disk access. @@ -529,7 +527,7 @@ dircache_root = buffer_alloc(0); if ((long)maindata.root_entry != (long)dircache_root) { - logf("Position missmatch"); + logf("Position mismatch"); close(fd); remove_dircache_file(); return -4; @@ -603,7 +601,6 @@ return 0; } -#endif /* HAVE_EEPROM_SETTINGS */ /** * Internal function which scans the disk and creates the dircache structure. @@ -727,9 +724,7 @@ return -3; logf("Building directory cache"); -#ifdef HAVE_EEPROM_SETTINGS remove_dircache_file(); -#endif /* Background build, dircache has been previously allocated */ if (dircache_size > 0)