Skip to content

Commit

Permalink
Fix #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 #230.
This issue is generally only reproducible in UT where taskSpawn
can be made to fail.
  • Loading branch information
jphickey authored and skliper committed Oct 31, 2019
1 parent 5cdd403 commit 049e101
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 049e101

Please sign in to comment.