summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-11-12 21:15:12 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-11-12 21:15:12 +0000
commitc257429f6101e31077c83a2213229a4976d82b31 (patch)
treeadca9ac58c482e60488693ba5cd907e3a31440ce /c
parent2183b65b81a955c059c4a8694a99d9e19974083d (diff)
downloadrtems-c257429f6101e31077c83a2213229a4976d82b31.tar.bz2
+ Moved error checks to before the dispatch disable where possible.
+ Modified correct return path to call _ITRON_return_errorno( E_OK ) instead of enabling dispatching and returning E_OK.
Diffstat (limited to 'c')
-rw-r--r--c/src/exec/itron/src/cre_tsk.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/c/src/exec/itron/src/cre_tsk.c b/c/src/exec/itron/src/cre_tsk.c
index 70ae6a2e81..d49f013a73 100644
--- a/c/src/exec/itron/src/cre_tsk.c
+++ b/c/src/exec/itron/src/cre_tsk.c
@@ -32,17 +32,11 @@ ER cre_tsk(
Priority_Control core_priority;
/*
- * Disable dispatching.
- */
-
- _Thread_Disable_dispatch();
-
- /*
* Validate Parameters.
*/
if ( pk_ctsk == NULL )
- _ITRON_return_errorno( E_PAR );
+ return E_PAR;
if ((pk_ctsk->tskatr != TA_ASM ) &&
(pk_ctsk->tskatr != TA_HLNG) &&
@@ -54,16 +48,22 @@ ER cre_tsk(
(pk_ctsk->tskatr != TA_COP5) &&
(pk_ctsk->tskatr != TA_COP6) &&
(pk_ctsk->tskatr != TA_COP7))
- _ITRON_return_errorno( E_RSATR );
+ return E_RSATR;
if (( pk_ctsk->itskpri <= 0 ) || ( pk_ctsk->itskpri >= 256 ))
- _ITRON_return_errorno( E_PAR );
+ return E_PAR;
if ( pk_ctsk->task == NULL )
- _ITRON_return_errorno( E_PAR );
+ return E_PAR;
if ( pk_ctsk->stksz < 0 )
- _ITRON_return_errorno( E_PAR );
+ return E_PAR;
/*
+ * Disable dispatching.
+ */
+
+ _Thread_Disable_dispatch();
+
+ /*
* allocate the thread.
*/
@@ -106,8 +106,7 @@ ER cre_tsk(
the_thread->Start.entry_point = (Thread_Entry) pk_ctsk->task;
- _Thread_Enable_dispatch();
- return E_OK;
+ _ITRON_return_errorno( E_OK );
}