From fcf8f53a631fe5f15f2b456bc34331de8e67a64b Mon Sep 17 00:00:00 2001
From: Lioncash <mathew1800@gmail.com>
Date: Wed, 24 Oct 2018 14:10:30 -0400
Subject: [PATCH] kernel/svc: Amend returned error code for invalid priorities
 in CreateThread

Like with the previous change, the kernel doesn't return NOT_AUTHORIZED
here. It returns INVALID_THREAD_PRIORITY.
---
 src/core/hle/kernel/svc.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index e7e4c59b67..a5302d924f 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -746,7 +746,7 @@ static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, V
     auto* const current_process = Core::CurrentProcess();
     const ResourceLimit& resource_limit = current_process->GetResourceLimit();
     if (resource_limit.GetMaxResourceValue(ResourceType::Priority) > priority) {
-        return ERR_NOT_AUTHORIZED;
+        return ERR_INVALID_THREAD_PRIORITY;
     }
 
     if (processor_id == THREADPROCESSORID_DEFAULT) {
-- 
GitLab