Skip to content

Commit

Permalink
Fix #1180, Remove impossible conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Mar 17, 2021
1 parent 7f8e475 commit 0a30525
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 35 deletions.
65 changes: 31 additions & 34 deletions modules/es/fsw/src/cfe_es_apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,42 +1287,39 @@ void CFE_ES_ProcessControlRequest(CFE_ES_AppId_t AppId)
break;
}

if (EventID != 0 && ReqName != NULL)
if (MessageDetail[0] != 0)
{
if (MessageDetail[0] != 0)
{
/* Detail message already set, assume it is an error event */
EventType = CFE_EVS_EventType_ERROR;
}
else if (StartupStatus != CFE_SUCCESS)
{
/* Make detail message for event containing startup error code */
EventType = CFE_EVS_EventType_ERROR;
snprintf(MessageDetail, sizeof(MessageDetail), "Failed: AppCreate Error 0x%08X.",
(unsigned int)StartupStatus);
}
else if (CleanupStatus != CFE_SUCCESS)
{
/* Make detail message for event containing cleanup error code */
EventType = CFE_EVS_EventType_ERROR;
snprintf(MessageDetail, sizeof(MessageDetail), "Failed: CleanUpApp Error 0x%08X.",
(unsigned int)CleanupStatus);
}
else if (CFE_RESOURCEID_TEST_DEFINED(NewAppId))
{
/* Record success message for event where app is restarted */
EventType = CFE_EVS_EventType_INFORMATION;
snprintf(MessageDetail, sizeof(MessageDetail), "Completed, AppID=%lu", CFE_RESOURCEID_TO_ULONG(NewAppId));
}
else
{
/* Record success message for event */
EventType = CFE_EVS_EventType_INFORMATION;
snprintf(MessageDetail, sizeof(MessageDetail), "Completed.");
}

CFE_EVS_SendEvent(EventID, EventType, "%s Application %s %s", ReqName, OrigAppName, MessageDetail);
/* Detail message already set, assume it is an error event */
EventType = CFE_EVS_EventType_ERROR;
}
else if (StartupStatus != CFE_SUCCESS)
{
/* Make detail message for event containing startup error code */
EventType = CFE_EVS_EventType_ERROR;
snprintf(MessageDetail, sizeof(MessageDetail), "Failed: AppCreate Error 0x%08X.",
(unsigned int)StartupStatus);
}
else if (CleanupStatus != CFE_SUCCESS)
{
/* Make detail message for event containing cleanup error code */
EventType = CFE_EVS_EventType_ERROR;
snprintf(MessageDetail, sizeof(MessageDetail), "Failed: CleanUpApp Error 0x%08X.",
(unsigned int)CleanupStatus);
}
else if (CFE_RESOURCEID_TEST_DEFINED(NewAppId))
{
/* Record success message for event where app is restarted */
EventType = CFE_EVS_EventType_INFORMATION;
snprintf(MessageDetail, sizeof(MessageDetail), "Completed, AppID=%lu", CFE_RESOURCEID_TO_ULONG(NewAppId));
}
else
{
/* Record success message for event */
EventType = CFE_EVS_EventType_INFORMATION;
snprintf(MessageDetail, sizeof(MessageDetail), "Completed.");
}

CFE_EVS_SendEvent(EventID, EventType, "%s Application %s %s", ReqName, OrigAppName, MessageDetail);

} /* End Function */

Expand Down
2 changes: 1 addition & 1 deletion modules/tbl/fsw/src/cfe_tbl_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ int32 CFE_TBL_EarlyInit(void)
}

j++;
} while ((j < CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS) && (Status >= CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE));
} while (j < CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS);
}

/* Try to obtain a previous image of the Critical Table Registry from the Critical Data Store */
Expand Down

0 comments on commit 0a30525

Please sign in to comment.