summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-10-25 07:10:26 +0200
committerGitHub <noreply@github.com>2018-10-25 07:10:26 +0200
commitc94db0e0719ad66c6d49bab29b8ed497c55a55f3 (patch)
tree89fc126616fd143866e23dab45a3d064a6c48f87 /src/core/hle/kernel/svc.cpp
parentMerge pull request #1524 from FernandoS27/layers-fix (diff)
parentkernel/errors: Remove now-unused, unnecessary, error codes (diff)
downloadyuzu-c94db0e0719ad66c6d49bab29b8ed497c55a55f3.tar
yuzu-c94db0e0719ad66c6d49bab29b8ed497c55a55f3.tar.gz
yuzu-c94db0e0719ad66c6d49bab29b8ed497c55a55f3.tar.bz2
yuzu-c94db0e0719ad66c6d49bab29b8ed497c55a55f3.tar.lz
yuzu-c94db0e0719ad66c6d49bab29b8ed497c55a55f3.tar.xz
yuzu-c94db0e0719ad66c6d49bab29b8ed497c55a55f3.tar.zst
yuzu-c94db0e0719ad66c6d49bab29b8ed497c55a55f3.zip
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 9a783d524..a5302d924 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -594,16 +594,17 @@ static ResultCode SetThreadPriority(Handle handle, u32 priority) {
}
const auto* const current_process = Core::CurrentProcess();
- SharedPtr<Thread> thread = current_process->GetHandleTable().Get<Thread>(handle);
- if (!thread) {
- return ERR_INVALID_HANDLE;
- }
// Note: The kernel uses the current process's resource limit instead of
// the one from the thread owner's resource limit.
const ResourceLimit& resource_limit = current_process->GetResourceLimit();
if (resource_limit.GetMaxResourceValue(ResourceType::Priority) > priority) {
- return ERR_NOT_AUTHORIZED;
+ return ERR_INVALID_THREAD_PRIORITY;
+ }
+
+ SharedPtr<Thread> thread = current_process->GetHandleTable().Get<Thread>(handle);
+ if (!thread) {
+ return ERR_INVALID_HANDLE;
}
thread->SetPriority(priority);
@@ -745,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) {