Skip to content

Commit

Permalink
Fix #374: CFE_ES_GetTaskInfo must be passed a task ID
Browse files Browse the repository at this point in the history
Fix 2 areas where the CFE_ES_GetTaskInfo() function could
have been passed an App ID rather than a task ID, which
would create an incorrect result.
  • Loading branch information
jphickey authored and skliper committed Oct 31, 2019
1 parent 7dbe161 commit 198abc6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/es/cfe_es_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ int32 CFE_ES_ListTasks(int32 fd)
/*
** Populate the AppInfo entry
*/
Result = CFE_ES_GetTaskInfo(&TaskInfo,i);
Result = CFE_ES_GetTaskInfo(&TaskInfo,CFE_ES_Global.TaskTable[i].TaskId);

if ( Result == CFE_SUCCESS )
{
Expand Down
21 changes: 19 additions & 2 deletions fsw/cfe-core/src/sb/cfe_sb_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,16 @@ int32 CFE_SB_DeletePipeFull(CFE_SB_PipeId_t PipeId,uint32 AppId)

CFE_SB_UnlockSharedData(__func__,__LINE__);

/*
* Get the app name of the actual pipe owner for the event string
* as this may be different than the task doing the deletion.
*
* Note: If this fails (e.g. bad AppID, it returns an empty string
*/
CFE_ES_GetAppName(FullName, Owner, sizeof(FullName));

CFE_EVS_SendEventWithAppID(CFE_SB_PIPE_DELETED_EID,CFE_EVS_EventType_DEBUG,CFE_SB.AppId,
"Pipe Deleted:id %d,owner %s",(int)PipeId, CFE_SB_GetAppTskName(Owner,FullName));
"Pipe Deleted:id %d,owner %s",(int)PipeId, FullName);

return CFE_SUCCESS;

Expand Down Expand Up @@ -460,8 +468,17 @@ int32 CFE_SB_SetPipeOpts(CFE_SB_PipeId_t PipeId, uint8 Opts)
CFE_SB.PipeTbl[PipeTblIdx].Opts = Opts;

CFE_SB_UnlockSharedData(__func__,__LINE__);

/*
* Get the app name of the actual pipe owner for the event string
* as this may be different than the task doing the deletion.
*
* Note: If this fails (e.g. bad AppID, it returns an empty string
*/
CFE_ES_GetAppName(FullName, Owner, sizeof(FullName));

CFE_EVS_SendEventWithAppID(CFE_SB_SETPIPEOPTS_EID,CFE_EVS_EventType_DEBUG,CFE_SB.AppId,
"Pipe opts set:id %d,owner %s, opts=0x%02x",(int)PipeId, CFE_SB_GetAppTskName(Owner,FullName), (unsigned int)Opts);
"Pipe opts set:id %d,owner %s, opts=0x%02x",(int)PipeId, FullName, (unsigned int)Opts);

return CFE_SUCCESS;
}/* end CFE_SB_SetPipeOpts */
Expand Down

0 comments on commit 198abc6

Please sign in to comment.