diff options
Diffstat (limited to 'src/kernel/settings.c')
-rw-r--r-- | src/kernel/settings.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/kernel/settings.c b/src/kernel/settings.c index 699196b..419341a 100644 --- a/src/kernel/settings.c +++ b/src/kernel/settings.c @@ -36,6 +36,11 @@ struct main_entry { static file_id_t fid; static uint32_t main_end; +void close_settings() { + drives->free_file(drives, fid); + fid = 0; +} + void init_settings() { fid = drives->get_file(drives, SETTINGS_FILE); if (!fid) @@ -47,6 +52,9 @@ void init_settings() { } bool try_find_setting(const char *name, struct main_entry *entry_out) { + if (!fid) + PANIC("setting requested after settings file closed"); + uint16_t name_len = 0; while (name[name_len]) if (++name_len == 256) |