From 049e1011bc681d21da043de92439f63f5700f139 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Mon, 21 Oct 2019 14:36:07 -0400 Subject: [PATCH] Fix #269: Correct error checking for taskSpawn 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. --- src/os/vxworks/osapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/vxworks/osapi.c b/src/os/vxworks/osapi.c index d1dea6c3b..a7cf8902e 100644 --- a/src/os/vxworks/osapi.c +++ b/src/os/vxworks/osapi.c @@ -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;