Commit 9e462469 authored by Jan Pohanka's avatar Jan Pohanka Committed by Anas Nashif
Browse files

lib: posix: Fix priority validity check in pthread_setschedparam


New priority value check was faultly done on zephyr priority instead
of posix one.
Signed-off-by: default avatarJan Pohanka <xhpohanka@gmail.com>
parent 9df168b5
Showing with 3 additions and 3 deletions
+3 -3
......@@ -277,12 +277,12 @@ int pthread_setschedparam(pthread_t pthread, int policy,
return EINVAL;
}
new_prio = posix_to_zephyr_priority(param->sched_priority, policy);
if (is_posix_prio_valid(new_prio, policy) == false) {
if (is_posix_prio_valid(param->sched_priority, policy) == false) {
return EINVAL;
}
new_prio = posix_to_zephyr_priority(param->sched_priority, policy);
k_thread_priority_set(thread, new_prio);
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment