mirror of https://github.com/ARMmbed/mbed-os.git
fix not writing version number into the file
parent
62ba220100
commit
7d916a9997
|
@ -267,16 +267,15 @@ void FileSecurityDb::set_entry_peer_sign_counter(
|
||||||
/* saving and loading from nvm */
|
/* saving and loading from nvm */
|
||||||
|
|
||||||
void FileSecurityDb::restore() {
|
void FileSecurityDb::restore() {
|
||||||
|
|
||||||
fseek(_db_file, DB_OFFSET_RESTORE, SEEK_SET);
|
|
||||||
|
|
||||||
/* restore if requested */
|
/* restore if requested */
|
||||||
bool restore_toggle;
|
bool restore_toggle = false;
|
||||||
if (fread(&restore_toggle, sizeof(bool), 1, _db_file) == 1) {
|
db_read(&restore_toggle, DB_OFFSET_RESTORE);
|
||||||
if (!restore_toggle) {
|
|
||||||
erase_db_file(_db_file);
|
if (!restore_toggle) {
|
||||||
return;
|
erase_db_file(_db_file);
|
||||||
}
|
|
||||||
|
db_write(&DB_VERSION, DB_OFFSET_VERSION);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
db_read(&_local_identity, DB_OFFSET_LOCAL_IDENTITY);
|
db_read(&_local_identity, DB_OFFSET_LOCAL_IDENTITY);
|
||||||
|
|
Loading…
Reference in New Issue