summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/taskgetaffinity.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-04-26 10:34:11 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-04-27 19:40:12 +0200
commit14526992418137af1b64d8be02a30fd91406195a (patch)
tree5286c85142b405d3e2facdab3830d233e1322df6 /cpukit/rtems/src/taskgetaffinity.c
parentrtems: Constify timer fire when directives (diff)
downloadrtems-14526992418137af1b64d8be02a30fd91406195a.tar.bz2
Return status code for _Scheduler_Get_affinity()
This avoids having conditional statements to get the API-specific status code.
Diffstat (limited to '')
-rw-r--r--cpukit/rtems/src/taskgetaffinity.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cpukit/rtems/src/taskgetaffinity.c b/cpukit/rtems/src/taskgetaffinity.c
index d08c2d6835..6ced283393 100644
--- a/cpukit/rtems/src/taskgetaffinity.c
+++ b/cpukit/rtems/src/taskgetaffinity.c
@@ -21,6 +21,7 @@
#endif
#include <rtems/rtems/tasks.h>
+#include <rtems/rtems/statusimpl.h>
#include <rtems/score/threadimpl.h>
#include <rtems/score/schedulerimpl.h>
@@ -33,7 +34,7 @@ rtems_status_code rtems_task_get_affinity(
Thread_Control *the_thread;
ISR_lock_Context lock_context;
Per_CPU_Control *cpu_self;
- bool ok;
+ Status_Control status;
if ( cpuset == NULL ) {
return RTEMS_INVALID_ADDRESS;
@@ -54,7 +55,7 @@ rtems_status_code rtems_task_get_affinity(
cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
_Thread_State_acquire_critical( the_thread, &lock_context );
- ok = _Scheduler_Get_affinity(
+ status = _Scheduler_Get_affinity(
the_thread,
cpusetsize,
cpuset
@@ -62,5 +63,5 @@ rtems_status_code rtems_task_get_affinity(
_Thread_State_release( the_thread, &lock_context );
_Thread_Dispatch_enable( cpu_self );
- return ok ? RTEMS_SUCCESSFUL : RTEMS_INVALID_NUMBER;
+ return _Status_Get( status );
}