From 9d82150f5a83e8dcf985de26799f99f7c46ec515 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 26 Apr 2021 11:22:39 +0200 Subject: Return status code for _Scheduler_Set_affinity() This avoids having conditional statements to get the API-specific status code. --- cpukit/rtems/src/tasksetaffinity.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cpukit/rtems/src') diff --git a/cpukit/rtems/src/tasksetaffinity.c b/cpukit/rtems/src/tasksetaffinity.c index c3cfbf08cb..84071b2f51 100644 --- a/cpukit/rtems/src/tasksetaffinity.c +++ b/cpukit/rtems/src/tasksetaffinity.c @@ -21,6 +21,7 @@ #endif #include +#include #include #include @@ -33,7 +34,7 @@ rtems_status_code rtems_task_set_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_set_affinity( cpu_self = _Thread_Dispatch_disable_critical( &lock_context ); _Thread_State_acquire_critical( the_thread, &lock_context ); - ok = _Scheduler_Set_affinity( + status = _Scheduler_Set_affinity( the_thread, cpusetsize, cpuset @@ -62,5 +63,5 @@ rtems_status_code rtems_task_set_affinity( _Thread_State_release( the_thread, &lock_context ); _Thread_Dispatch_enable( cpu_self ); - return ok ? RTEMS_SUCCESSFUL : RTEMS_INVALID_NUMBER; + return _Status_Get( status ); } -- cgit v1.2.3