Skip to content

Commit

Permalink
Merge pull request #906 from jphickey/fix-886-moduleInfoGet-err
Browse files Browse the repository at this point in the history
Fix #886, return moduleInfoGet error
  • Loading branch information
astrogeco authored Mar 22, 2021
2 parents 0ad9eb8 + 1aad679 commit 116677b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/os/vxworks/src/os-impl-loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ int32 OS_ModuleGetInfo_Impl(const OS_object_token_t *token, OS_module_prop_t *mo
MODULE_INFO vxModuleInfo;
STATUS vxStatus;
OS_impl_module_internal_record_t *impl;
int32 return_code;

impl = OS_OBJECT_TABLE_GET(OS_impl_module_table, *token);

Expand All @@ -176,6 +177,7 @@ int32 OS_ModuleGetInfo_Impl(const OS_object_token_t *token, OS_module_prop_t *mo
if (vxStatus == ERROR)
{
OS_DEBUG("OSAL: OS_ModuleInfoGet Error from vxWorks: %d\n", vxStatus);
return_code = OS_ERROR;
}
else
{
Expand All @@ -186,8 +188,10 @@ int32 OS_ModuleGetInfo_Impl(const OS_object_token_t *token, OS_module_prop_t *mo
module_prop->addr.data_size = vxModuleInfo.segInfo.dataSize;
module_prop->addr.bss_address = (cpuaddr)vxModuleInfo.segInfo.bssAddr;
module_prop->addr.bss_size = vxModuleInfo.segInfo.bssSize;

return_code = OS_SUCCESS;
}

return (OS_SUCCESS);
return (return_code);

} /* end OS_ModuleGetInfo_Impl */
6 changes: 3 additions & 3 deletions src/unit-test-coverage/vxworks/src/coveragetest-loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ void Test_OS_ModuleGetInfo_Impl(void)
UtAssert_True(module_prop.addr.valid, "addresses in output valid");

/*
* Note this still returns SUCCESS if the underlying call fails,
* but the boolean in the output struct should be false.
* This returns OS_ERROR if the underlying call fails,
* and the boolean in the output struct should be false.
*/
memset(&module_prop, 0, sizeof(module_prop));
UT_SetDefaultReturnValue(UT_KEY(OCS_moduleInfoGet), OCS_ERROR);
OSAPI_TEST_FUNCTION_RC(OS_ModuleGetInfo_Impl(&token, &module_prop), OS_SUCCESS);
OSAPI_TEST_FUNCTION_RC(OS_ModuleGetInfo_Impl(&token, &module_prop), OS_ERROR);
UT_ClearDefaultReturnValue(UT_KEY(OCS_moduleInfoGet));
UtAssert_True(!module_prop.addr.valid, "addresses in output not valid");
}
Expand Down

0 comments on commit 116677b

Please sign in to comment.