Skip to content

Commit

Permalink
Fix #1506, Align Table Name reporting in CFE_TBL_Register()
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Oct 24, 2022
1 parent be88a07 commit 2eebe2e
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions modules/tbl/fsw/src/cfe_tbl_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,22 @@ CFE_Status_t CFE_TBL_Register(CFE_TBL_Handle_t *TblHandlePtr, const char *Name,
{
Status = CFE_TBL_ERR_INVALID_SIZE;

CFE_ES_WriteToSysLog("%s: Table %s has size of zero\n", __func__, Name);
CFE_ES_WriteToSysLog("%s: Table '%s' has size of zero\n", __func__, TblName);
}
else if ((Size > CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE) &&
((TblOptionFlags & CFE_TBL_OPT_BUFFER_MSK) == CFE_TBL_OPT_SNGL_BUFFER))
{
Status = CFE_TBL_ERR_INVALID_SIZE;

CFE_ES_WriteToSysLog("%s: Single Buffered Table '%s' has size %d > %d\n", __func__, Name, (int)Size,
CFE_ES_WriteToSysLog("%s: Single Buffered Table '%s' has size %d > %d\n", __func__, TblName, (int)Size,
CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE);
}
else if ((Size > CFE_PLATFORM_TBL_MAX_DBL_TABLE_SIZE) &&
((TblOptionFlags & CFE_TBL_OPT_BUFFER_MSK) == CFE_TBL_OPT_DBL_BUFFER))
{
Status = CFE_TBL_ERR_INVALID_SIZE;

CFE_ES_WriteToSysLog("%s: Dbl Buffered Table '%s' has size %d > %d\n", __func__, Name, (int)Size,
CFE_ES_WriteToSysLog("%s: Dbl Buffered Table '%s' has size %d > %d\n", __func__, TblName, (int)Size,
CFE_PLATFORM_TBL_MAX_DBL_TABLE_SIZE);
}

Expand All @@ -125,7 +125,7 @@ CFE_Status_t CFE_TBL_Register(CFE_TBL_Handle_t *TblHandlePtr, const char *Name,
Status = CFE_TBL_ERR_INVALID_OPTIONS;

CFE_ES_WriteToSysLog("%s: User Def tbl '%s' cannot be dbl buff, load/dump or critical\n", __func__,
Name);
TblName);
}
}
else if ((TblOptionFlags & CFE_TBL_OPT_LD_DMP_MSK) == CFE_TBL_OPT_DUMP_ONLY)
Expand All @@ -137,7 +137,7 @@ CFE_Status_t CFE_TBL_Register(CFE_TBL_Handle_t *TblHandlePtr, const char *Name,
Status = CFE_TBL_ERR_INVALID_OPTIONS;

CFE_ES_WriteToSysLog("%s: Dump Only tbl '%s' cannot be double buffered or critical\n", __func__,
Name);
TblName);
}
}
}
Expand Down Expand Up @@ -254,9 +254,9 @@ CFE_Status_t CFE_TBL_Register(CFE_TBL_Handle_t *TblHandlePtr, const char *Name,
Status = CFE_ES_GetPoolBuf(&RegRecPtr->Buffers[0].BufferPtr, CFE_TBL_Global.Buf.PoolHdl, Size);
if (Status < 0)
{
CFE_ES_WriteToSysLog("%s: 1st Buf Alloc GetPool fail Stat=0x%08X MemPoolHndl=0x%08lX\n",
__func__, (unsigned int)Status,
CFE_RESOURCEID_TO_ULONG(CFE_TBL_Global.Buf.PoolHdl));
CFE_ES_WriteToSysLog(
"%s: 1st Buf Alloc GetPool for '%s' fail Stat=0x%08X MemPoolHndl=0x%08lX\n", __func__,
TblName, (unsigned int)Status, CFE_RESOURCEID_TO_ULONG(CFE_TBL_Global.Buf.PoolHdl));
}
else
{
Expand All @@ -279,9 +279,9 @@ CFE_Status_t CFE_TBL_Register(CFE_TBL_Handle_t *TblHandlePtr, const char *Name,
Status = CFE_ES_GetPoolBuf(&RegRecPtr->Buffers[1].BufferPtr, CFE_TBL_Global.Buf.PoolHdl, Size);
if (Status < 0)
{
CFE_ES_WriteToSysLog("%s: 2nd Buf Alloc GetPool fail Stat=0x%08X MemPoolHndl=0x%08lX\n",
__func__, (unsigned int)Status,
CFE_RESOURCEID_TO_ULONG(CFE_TBL_Global.Buf.PoolHdl));
CFE_ES_WriteToSysLog(
"%s: 2nd Buf Alloc GetPool for '%s' fail Stat=0x%08X MemPoolHndl=0x%08lX\n", __func__,
TblName, (unsigned int)Status, CFE_RESOURCEID_TO_ULONG(CFE_TBL_Global.Buf.PoolHdl));
}
else
{
Expand Down Expand Up @@ -364,8 +364,8 @@ CFE_Status_t CFE_TBL_Register(CFE_TBL_Handle_t *TblHandlePtr, const char *Name,
/* 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);
CFE_ES_WriteToSysLog("%s: Failed to get work buffer for Table '%s' (ErrCode=0x%08X)\n",
__func__, TblName, (unsigned int)Status);
}
else
{
Expand All @@ -375,8 +375,8 @@ 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);
CFE_ES_WriteToSysLog("%s: Failed to recover Table '%s' from CDS (ErrCode=0x%08X)\n",
__func__, TblName, (unsigned int)Status);
}
}

Expand Down Expand Up @@ -420,8 +420,8 @@ 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);
CFE_ES_WriteToSysLog("%s: Failed to recover Table '%s' info from CDS TblReg\n",
__func__, TblName);
Status = CFE_SUCCESS;
}
}
Expand Down Expand Up @@ -452,16 +452,16 @@ CFE_Status_t CFE_TBL_Register(CFE_TBL_Handle_t *TblHandlePtr, const char *Name,
else
{
CFE_ES_WriteToSysLog("%s: Failed to find a free Crit Tbl Reg Rec for '%s'\n", __func__,
RegRecPtr->Name);
TblName);
}

/* Mark the table as critical for future reference */
RegRecPtr->CriticalTable = true;
}
else if (Status != CFE_TBL_INFO_RECOVERED_TBL)
{
CFE_ES_WriteToSysLog("%s: Failed to register '%s.%s' as a CDS (ErrCode=0x%08X)\n", __func__,
AppName, Name, (unsigned int)Status);
CFE_ES_WriteToSysLog("%s: Failed to register Table '%s' as a CDS (ErrCode=0x%08X)\n",
__func__, TblName, (unsigned int)Status);

/* Notify caller that although they asked for it to be critical, it isn't */
Status = CFE_TBL_WARN_NOT_CRITICAL;
Expand Down

0 comments on commit 2eebe2e

Please sign in to comment.