Skip to content

Commit

Permalink
Fix nasa#269: Correct error checking for taskSpawn
Browse files Browse the repository at this point in the history
The test for failure of taskSpawn should be for the value of
ERROR, not 0, per the VxWorks API documentation.

Found when implementing the unit test improvements in nasa#230.
This issue is generally only reproducible in UT where taskSpawn
can be made to fail.
  • Loading branch information
jphickey committed Oct 21, 2019
1 parent ad88aa1 commit 5dd91ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/os/vxworks/osapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1759,7 +1759,7 @@ int32 OS_ConsoleCreate_Impl(uint32 local_id)
(FUNCPTR)OS_ConsoleTask_Entry,
local_id,0,0,0,0,0,0,0,0,0);

if (local->taskid == (TASK_ID)0)
if (local->taskid == (TASK_ID)ERROR)
{
OS_DEBUG("taskSpawn() - vxWorks errno %d\n",errno);
return_code = OS_ERROR;
Expand Down

0 comments on commit 5dd91ba

Please sign in to comment.