From bbc93c119c72f981b5091fa06aea5e7369b79a59 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 26 Apr 2021 13:36:46 +0200 Subject: Return status code for _Thread_Start() This avoids having conditional statements to get the API-specific status code. --- cpukit/rtems/src/taskstart.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cpukit/rtems/src/taskstart.c') diff --git a/cpukit/rtems/src/taskstart.c b/cpukit/rtems/src/taskstart.c index da29240961..eca9b5795d 100644 --- a/cpukit/rtems/src/taskstart.c +++ b/cpukit/rtems/src/taskstart.c @@ -21,6 +21,7 @@ #endif #include +#include #include rtems_status_code rtems_task_start( @@ -40,7 +41,7 @@ rtems_status_code rtems_task_start( }; Thread_Control *the_thread; ISR_lock_Context lock_context; - bool ok; + Status_Control status; the_thread = _Thread_Get( id, &lock_context ); @@ -54,7 +55,7 @@ rtems_status_code rtems_task_start( return RTEMS_INVALID_ID; } - ok = _Thread_Start( the_thread, &entry, &lock_context ); + status = _Thread_Start( the_thread, &entry, &lock_context ); - return ok ? RTEMS_SUCCESSFUL : RTEMS_INCORRECT_STATE; + return _Status_Get( status ); } -- cgit v1.2.3