From 11306d7121f414695c46ef9d6a46125c2cc5db9b Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Wed, 5 May 2021 16:51:06 +0000 Subject: Kernel: Modify TimeManagement::current_time(..) API so it can't fail. (#6869) The fact that current_time can "fail" makes its use a bit awkward. All callers in the Kernel are trusted besides syscalls, so assert that they never get there, and make sure all current callers perform validation of the clock_id with TimeManagement::is_valid_clock_id(). I have fuzzed this change locally for a bit to make sure I didn't miss any obvious regression. --- Kernel/Time/TimeManagement.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Kernel/Time/TimeManagement.cpp') diff --git a/Kernel/Time/TimeManagement.cpp b/Kernel/Time/TimeManagement.cpp index 3305eeb636..153b02bf21 100644 --- a/Kernel/Time/TimeManagement.cpp +++ b/Kernel/Time/TimeManagement.cpp @@ -44,7 +44,7 @@ bool TimeManagement::is_valid_clock_id(clockid_t clock_id) }; } -KResultOr