summaryrefslogtreecommitdiff
path: root/src/kernel/settings.c
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2021-03-11 22:00:22 -0500
committerBenji Dial <benji6283@gmail.com>2021-03-11 22:00:22 -0500
commit5fcf57739e68a8b5053e03778aaee0eed445babd (patch)
treee7a8bab18668d112e58b1b48190195035c71fa8a /src/kernel/settings.c
parent0f2398d1f622cce37925f52d978d92e6cce1c7a9 (diff)
downloadportland-os-5fcf57739e68a8b5053e03778aaee0eed445babd.tar.gz
settings editor, and lots of changes in service of that
Diffstat (limited to 'src/kernel/settings.c')
-rw-r--r--src/kernel/settings.c8
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)