summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadsetaffinitynp.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-04-26 11:22:39 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-04-27 19:40:13 +0200
commit9d82150f5a83e8dcf985de26799f99f7c46ec515 (patch)
treefe568eaa83c10f1bfa6374dbe92649fac93681b6 /cpukit/posix/src/pthreadsetaffinitynp.c
parentrtems: Change rtems_task_get_affinity() status (diff)
downloadrtems-9d82150f5a83e8dcf985de26799f99f7c46ec515.tar.bz2
Return status code for _Scheduler_Set_affinity()
This avoids having conditional statements to get the API-specific status code.
Diffstat (limited to '')
-rw-r--r--cpukit/posix/src/pthreadsetaffinitynp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cpukit/posix/src/pthreadsetaffinitynp.c b/cpukit/posix/src/pthreadsetaffinitynp.c
index ae91d135e1..9cb29ac167 100644
--- a/cpukit/posix/src/pthreadsetaffinitynp.c
+++ b/cpukit/posix/src/pthreadsetaffinitynp.c
@@ -28,6 +28,7 @@
#include <rtems/score/threadimpl.h>
#include <rtems/score/schedulerimpl.h>
+#include <rtems/posix/posixapi.h>
int pthread_setaffinity_np(
pthread_t thread,
@@ -38,7 +39,7 @@ int pthread_setaffinity_np(
Thread_Control *the_thread;
ISR_lock_Context lock_context;
Per_CPU_Control *cpu_self;
- bool ok;
+ Status_Control status;
if ( cpuset == NULL ) {
return EFAULT;
@@ -53,7 +54,7 @@ int pthread_setaffinity_np(
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
@@ -61,6 +62,6 @@ int pthread_setaffinity_np(
_Thread_State_release( the_thread, &lock_context );
_Thread_Dispatch_enable( cpu_self );
- return ok ? 0 : EINVAL;
+ return _POSIX_Get_error( status );
}
#endif