From f453e8e1704ac52e7e214d789f7eebc28df0ba14 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sat, 1 Apr 2023 00:30:33 +0300 Subject: [PATCH] Kernel: Shell 'time' prints the time even if command fails --- kernel/kernel/Shell.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/kernel/Shell.cpp b/kernel/kernel/Shell.cpp index 429661a9..aea1e1c8 100644 --- a/kernel/kernel/Shell.cpp +++ b/kernel/kernel/Shell.cpp @@ -275,9 +275,11 @@ argument_done: auto new_args = arguments; new_args.remove(0); auto start = PIT::ms_since_boot(); - TRY(process_command(new_args)); + auto ret = process_command(new_args); auto duration = PIT::ms_since_boot() - start; TTY_PRINTLN("took {} ms", duration); + if (ret.is_error()) + return ret.error(); } else if (arguments.front() == "thread") {