Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2280, Move calls to CFE_ES_GetAppName() higher to reduce code duplication #2281

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions modules/tbl/fsw/src/cfe_tbl_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,14 @@ CFE_Status_t CFE_TBL_Register(CFE_TBL_Handle_t *TblHandlePtr, const char *Name,
{
Status = CFE_TBL_GetWorkingBuffer(&WorkingBufferPtr, RegRecPtr, true);

CFE_ES_GetAppName(AppName, ThisAppId, sizeof(AppName));

if (Status != CFE_SUCCESS)
{
/* Unable to get a working buffer - this error is not really */
/* possible at this point during table registration. But we */
/* do need to handle the error case because if the function */
/* call did fail, WorkingBufferPtr would be a NULL pointer. */
CFE_ES_GetAppName(AppName, ThisAppId, sizeof(AppName));
CFE_ES_WriteToSysLog("%s: Failed to get work buffer for '%s.%s' (ErrCode=0x%08X)\n",
__func__, AppName, Name, (unsigned int)Status);
}
Expand All @@ -374,7 +375,6 @@ CFE_Status_t CFE_TBL_Register(CFE_TBL_Handle_t *TblHandlePtr, const char *Name,

if (Status != CFE_SUCCESS)
{
CFE_ES_GetAppName(AppName, ThisAppId, sizeof(AppName));
CFE_ES_WriteToSysLog("%s: Failed to recover '%s.%s' from CDS (ErrCode=0x%08X)\n",
__func__, AppName, Name, (unsigned int)Status);
}
Expand Down Expand Up @@ -419,7 +419,6 @@ CFE_Status_t CFE_TBL_Register(CFE_TBL_Handle_t *TblHandlePtr, const char *Name,
{
/* If an error occurred while trying to get the previous contents registry info, */
/* Log the error in the System Log and pretend like we created a new CDS */
CFE_ES_GetAppName(AppName, ThisAppId, sizeof(AppName));
CFE_ES_WriteToSysLog("%s: Failed to recover '%s.%s' info from CDS TblReg\n",
__func__, AppName, Name);
Status = CFE_SUCCESS;
Expand Down