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 #1180, Remove impossible conditions #1237

Merged
Merged
Show file tree
Hide file tree
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
63 changes: 29 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,37 @@ 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