[fdb] close stream pointer via fclose() (#268)
Co-authored-by: Oleg Hahm <oleg@riot-os.org>
This commit is contained in:
parent
c1226f337a
commit
86f5550e60
|
@ -210,7 +210,7 @@ static void update_file_cache(fdb_db_t db, uint32_t sec_addr, FILE *fd)
|
|||
else {
|
||||
/* cache is full, move to end */
|
||||
for (int i = FDB_FILE_CACHE_TABLE_SIZE - 1; i > 0; i--) {
|
||||
close(db->cur_file[i]);
|
||||
fclose(db->cur_file[i]);
|
||||
memcpy(&db->cur_file[i], &db->cur_file[i - 1], sizeof(db->cur_file[0]));
|
||||
memcpy(&db->cur_file_sec[i], &db->cur_file_sec[i - 1], sizeof(db->cur_file_sec[0]));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue