From 6ce03ff0ed4851fcd8c6aeec15a15f77a2cb24f5 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 7 Nov 2022 03:16:43 +0200 Subject: [PATCH] Update KThread.cpp --- KThread.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/KThread.cpp b/KThread.cpp index 52e8277..4ee9b66 100644 --- a/KThread.cpp +++ b/KThread.cpp @@ -81,12 +81,12 @@ void KernelMainThread() // TODO: Untested! Execute::SpawnData ret = Execute::Spawn(Config.InitPath, argc, (uint64_t)argv.data()); - ret.Thread->SetCritical(true); if (ret.Status != Execute::ExStatus::OK) { - KPrint("\eE85230Failed to start %s! Code: %d", Config.InitPath, ret); + KPrint("\eE85230Failed to start %s! Code: %d", Config.InitPath, ret.Status); CPU::Halt(true); } + ret.Thread->SetCritical(true); TaskManager->WaitForThread(ret.Thread); KPrint("\eE85230Userspace process exited with code %d", ret.Thread->GetExitCode()); error("Userspace process exited with code %d (%#x)", ret.Thread->GetExitCode(), ret.Thread->GetExitCode());