From 7430778a773cfdb97bed3c77c17f7c737706ba6a Mon Sep 17 00:00:00 2001 From: Lukas Oesch Date: Mon, 9 Mar 2026 23:54:54 +0100 Subject: add todos --- kernel/filesystem/src/file_descriptor_table.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'kernel/filesystem/src/file_descriptor_table.cpp') diff --git a/kernel/filesystem/src/file_descriptor_table.cpp b/kernel/filesystem/src/file_descriptor_table.cpp index 0c79431..645da9f 100644 --- a/kernel/filesystem/src/file_descriptor_table.cpp +++ b/kernel/filesystem/src/file_descriptor_table.cpp @@ -49,11 +49,13 @@ namespace filesystem auto file_descriptor_table::get_file(int fd) -> open_file_description & { + // TODO BA-FS26 do not panic, its an user error if (fd < 0) { kapi::system::panic("[FILESYSTEM] get_file called with negative descriptor."); } + // TODO BA-FS26 do not panic, its an user error auto const index = static_cast(fd); if (index >= m_open_files.size() || m_open_files[index] == nullptr) { @@ -65,17 +67,21 @@ namespace filesystem auto file_descriptor_table::remove_file(int fd) -> void { + // TODO BA-FS26 do not panic, its an user error if (fd < 0) { kapi::system::panic("[FILESYSTEM] remove_file called with negative descriptor."); } + // TODO BA-FS26 do not panic, its an user error auto const index = static_cast(fd); if (index >= m_open_files.size()) { kapi::system::panic("[FILESYSTEM] remove_file called with out-of-range descriptor."); } + // TODO BA-FS26 + // delete m_open_files[index]; m_open_files[index] = nullptr; } } // namespace filesystem \ No newline at end of file -- cgit v1.2.3