--- ../../temp/rockbox-daily-20020814/apps/settings.c 2002-08-14 06:00:02.000000000 +0200 +++ ../apps/settings.c 2002-08-14 11:47:55.000000000 +0200 @@ -126,6 +126,7 @@ static int save_config_buffer( void ) { unsigned short chksum; + int result = 0; #ifdef HAVE_RTC unsigned int i; @@ -147,23 +148,28 @@ that it would write a number of bytes at a time since the RTC chip supports that, but this will have to do for now 8-) */ for (i=0; i < CONFIG_BLOCK_SIZE; i++ ) { - int r = rtc_write(0x14+i, rtc_config_block[i]); - if (r) { + result = rtc_write(0x14+i, rtc_config_block[i]); + if (result) { DEBUGF( "save_config_buffer: rtc_write failed at addr 0x%02x: %d\n", 14+i, r ); - return r; + break; } } #else if(battery_level_safe() && (fat_startsector()!=0)) - return !ata_write_sectors( 61, 1, rtc_config_block); + result = !ata_write_sectors( 61, 1, rtc_config_block); else - return -1; + result = -1; #endif - return 0; + if (!result) + { + last_checksum = chksum; + } + + return result; } /*