From 4eeba0893678b60a9cfe43ba20e1fa1ed58d40af Mon Sep 17 00:00:00 2001 From: Avi Weiss Date: Thu, 30 Mar 2023 06:23:57 +1000 Subject: [PATCH] Fix #1407, Add error report on EVS failure during log header write --- modules/evs/fsw/inc/cfe_evs_eventids.h | 11 +++++++++++ modules/evs/fsw/src/cfe_evs_log.c | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/modules/evs/fsw/inc/cfe_evs_eventids.h b/modules/evs/fsw/inc/cfe_evs_eventids.h index 72003ed3e..050485052 100644 --- a/modules/evs/fsw/inc/cfe_evs_eventids.h +++ b/modules/evs/fsw/inc/cfe_evs_eventids.h @@ -179,6 +179,17 @@ */ #define CFE_EVS_ERR_CRDATFILE_EID 13 +/** + * \brief EVS Write File Header to Log File Failure Event ID + * + * \par Type: ERROR + * + * \par Cause: + * + * Bytes written during Write File Header to Log File was not equal to the expected header size. + */ +#define CFE_EVS_WRITE_HEADER_ERR_EID 14 + /** * \brief EVS Invalid Command Code Received Event ID * diff --git a/modules/evs/fsw/src/cfe_evs_log.c b/modules/evs/fsw/src/cfe_evs_log.c index 63ed9b541..c1c237560 100644 --- a/modules/evs/fsw/src/cfe_evs_log.c +++ b/modules/evs/fsw/src/cfe_evs_log.c @@ -216,6 +216,12 @@ int32 CFE_EVS_WriteLogDataFileCmd(const CFE_EVS_WriteLogDataFileCmd_t *data) LogFilename); } } + else + { + EVS_SendEvent(CFE_EVS_WRITE_HEADER_ERR_EID, CFE_EVS_EventType_ERROR, + "Write File Header to Log File Error: WriteHdr RC: %d, Expected: %d, filename = %s", + (int)BytesWritten, (int)sizeof(LogFileHdr), LogFilename); + } OS_close(LogFileHandle); }