Skip to content

Commit

Permalink
Fix nasa#308, Improve SB create pipe error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
CDKnightNASA authored and skliper committed Jan 14, 2020
1 parent 2b27dfc commit 25e5d9b
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions fsw/cfe-core/src/sb/cfe_sb_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,27 @@ int32 CFE_SB_CreatePipe(CFE_SB_PipeId_t *PipeIdPtr, uint16 Depth, const char *

/* if OS_QueueCreate() failed because the pipe name passed in was already in use... */
/* let's make sure we don't alter the user's pipe ID data */
if (Status == CFE_OS_ERR_NAME_TAKEN){
*PipeIdPtr = OriginalPipeIdParamValue;
}

CFE_EVS_SendEventWithAppID(CFE_SB_CR_PIPE_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
switch(Status) {
case CFE_OS_ERR_NAME_TAKEN:
CFE_EVS_SendEventWithAppID(CFE_SB_CR_PIPE_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"CreatePipeErr:OS_QueueCreate failed, name taken (app=%s, name=%s)",
CFE_SB_GetAppTskName(TskId,FullName), PipeName);

*PipeIdPtr = OriginalPipeIdParamValue;

break;
case OS_ERR_NO_FREE_IDS:
CFE_EVS_SendEventWithAppID(CFE_SB_CR_PIPE_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"CreatePipeErr:OS_QueueCreate failed, no free id's (app=%s)",
CFE_SB_GetAppTskName(TskId,FullName));

break;
default:
CFE_EVS_SendEventWithAppID(CFE_SB_CR_PIPE_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"CreatePipeErr:OS_QueueCreate returned %d,app %s",
(int)Status,CFE_SB_GetAppTskName(TskId,FullName));
}/* end switch(Status) */

return CFE_SB_PIPE_CR_ERR;
}/* end if */

Expand Down

0 comments on commit 25e5d9b

Please sign in to comment.