Skip to content

Commit

Permalink
Fix #623, Deprecates OS_FS_* defines that aren't unique to FS
Browse files Browse the repository at this point in the history
  • Loading branch information
dmknutsen committed Apr 17, 2020
1 parent 60a5f65 commit 38f035f
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/es/cfe_es_apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void CFE_ES_StartApplications(uint32 ResetType, const char *StartFilePath )
while(1)
{
ReadStatus = OS_read(AppFile, &c, 1);
if ( ReadStatus == OS_FS_ERROR )
if ( ReadStatus == OS_ERROR )
{
CFE_ES_WriteToSysLog ("ES Startup: Error Reading Startup file. EC = 0x%08X\n",(unsigned int)ReadStatus);
break;
Expand Down
18 changes: 9 additions & 9 deletions fsw/cfe-core/src/es/cfe_es_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ int32 CFE_ES_ShellOutputCommand(const char * CmdString, const char *Filename)

fd = OS_creat(Filename, OS_READ_WRITE);

if (fd < OS_FS_SUCCESS)
if (fd < OS_SUCCESS)
{
Result = OS_FS_ERROR;
Result = OS_ERROR;
}

else
Expand Down Expand Up @@ -113,11 +113,11 @@ int32 CFE_ES_ShellOutputCommand(const char * CmdString, const char *Filename)
/* seek to the end of the file to get it's size */
FileSize = OS_lseek(fd,0,OS_SEEK_END);

if (FileSize == OS_FS_ERROR)
if (FileSize == OS_ERROR)
{
OS_close(fd);
CFE_ES_WriteToSysLog("OS_lseek call failed from CFE_ES_ShellOutputCmd 1\n");
Result = OS_FS_ERROR;
Result = OS_ERROR;
}


Expand Down Expand Up @@ -153,11 +153,11 @@ int32 CFE_ES_ShellOutputCommand(const char * CmdString, const char *Filename)
/* seek to the end of the file again to get it's new size */
FileSize = OS_lseek(fd,0,OS_SEEK_END);

if (FileSize == OS_FS_ERROR)
if (FileSize == OS_ERROR)
{
OS_close(fd);
CFE_ES_WriteToSysLog("OS_lseek call failed from CFE_ES_ShellOutputCmd 2\n");
Result = OS_FS_ERROR;
Result = OS_ERROR;
}


Expand Down Expand Up @@ -210,9 +210,9 @@ int32 CFE_ES_ShellOutputCommand(const char * CmdString, const char *Filename)

/* Close the file descriptor */
OS_close(fd);
} /* if FilseSize == OS_FS_ERROR */
} /* if FileSeize == OS_FS_ERROR */
}/* if fd < OS_FS_SUCCESS */
} /* if FilseSize == OS_ERROR */
} /* if FileSeize == OS_ERROR */
}/* if fd < OS_SUCCESS */


/* cppcheck-suppress duplicateExpression */
Expand Down
14 changes: 7 additions & 7 deletions fsw/cfe-core/src/es/cfe_es_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ void CFE_ES_InitializeFileSystems(uint32 StartType)
if ( StartType == CFE_PSP_RST_TYPE_POWERON )
{
RetStatus = OS_mkfs((void *)RamDiskMemoryAddress, "/ramdev0", "RAM", CFE_PLATFORM_ES_RAM_DISK_SECTOR_SIZE, CFE_PLATFORM_ES_RAM_DISK_NUM_SECTORS );
if ( RetStatus != OS_FS_SUCCESS )
if ( RetStatus != OS_SUCCESS )
{
CFE_ES_WriteToSysLog("ES Startup: Error Creating Volatile(RAM) Volume. EC = 0x%08X\n",(unsigned int)RetStatus);

Expand All @@ -558,7 +558,7 @@ void CFE_ES_InitializeFileSystems(uint32 StartType)
else
{
RetStatus = OS_initfs((void *)RamDiskMemoryAddress, "/ramdev0", "RAM", CFE_PLATFORM_ES_RAM_DISK_SECTOR_SIZE, CFE_PLATFORM_ES_RAM_DISK_NUM_SECTORS );
if ( RetStatus != OS_FS_SUCCESS )
if ( RetStatus != OS_SUCCESS )
{
CFE_ES_WriteToSysLog("ES Startup: Error Initializing Volatile(RAM) Volume. EC = 0x%08X\n",(unsigned int)RetStatus);
CFE_ES_WriteToSysLog("ES Startup: Formatting Volatile(RAM) Volume.\n");
Expand Down Expand Up @@ -586,7 +586,7 @@ void CFE_ES_InitializeFileSystems(uint32 StartType)
** Now, mount the RAM disk
*/
RetStatus = OS_mount("/ramdev0", CFE_PLATFORM_ES_RAM_DISK_MOUNT_STRING);
if ( RetStatus != OS_FS_SUCCESS )
if ( RetStatus != OS_SUCCESS )
{
CFE_ES_WriteToSysLog("ES Startup: Error Mounting Volatile(RAM) Volume. EC = 0x%08X\n",(unsigned int)RetStatus);
/*
Expand Down Expand Up @@ -642,14 +642,14 @@ void CFE_ES_InitializeFileSystems(uint32 StartType)
** First, unmount the disk
*/
RetStatus = OS_unmount(CFE_PLATFORM_ES_RAM_DISK_MOUNT_STRING);
if ( RetStatus == OS_FS_SUCCESS )
if ( RetStatus == OS_SUCCESS )
{

/*
** Remove the file system from the OSAL
*/
RetStatus = OS_rmfs("/ramdev0");
if ( RetStatus == OS_FS_SUCCESS )
if ( RetStatus == OS_SUCCESS )
{

/*
Expand All @@ -658,13 +658,13 @@ void CFE_ES_InitializeFileSystems(uint32 StartType)
RetStatus = OS_mkfs((void *)RamDiskMemoryAddress, "/ramdev0",
"RAM", CFE_PLATFORM_ES_RAM_DISK_SECTOR_SIZE,
CFE_PLATFORM_ES_RAM_DISK_NUM_SECTORS );
if ( RetStatus == OS_FS_SUCCESS )
if ( RetStatus == OS_SUCCESS )
{
/*
** Last, remount the disk
*/
RetStatus = OS_mount("/ramdev0", CFE_PLATFORM_ES_RAM_DISK_MOUNT_STRING);
if ( RetStatus != OS_FS_SUCCESS )
if ( RetStatus != OS_SUCCESS )
{
CFE_ES_WriteToSysLog("ES Startup: Error Re-Mounting Volatile(RAM) Volume. EC = 0x%08X\n",(unsigned int)RetStatus);
/*
Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/es/cfe_es_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -1887,7 +1887,7 @@ int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistry_t *data)
/* Create a new dump file, overwriting anything that may have existed previously */
FileDescriptor = OS_creat(DumpFilename, OS_WRITE_ONLY);

if (FileDescriptor >= OS_FS_SUCCESS)
if (FileDescriptor >= OS_SUCCESS)
{
/* Initialize the standard cFE File Header for the Dump File */
CFE_FS_InitHeader(&StdFileHeader, "CDS_Registry", CFE_FS_SubType_ES_CDS_REG);
Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/evs/cfe_evs_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ int32 CFE_EVS_WriteLogDataFileCmd(const CFE_EVS_WriteLogDataFile_t *data)
/* Create the log file */
LogFileHandle = OS_creat(LogFilename, OS_WRITE_ONLY);

if (LogFileHandle < OS_FS_SUCCESS)
if (LogFileHandle < OS_SUCCESS)
{
EVS_SendEvent(CFE_EVS_ERR_CRLOGFILE_EID, CFE_EVS_EventType_ERROR,
"Write Log File Command Error: OS_creat = 0x%08X, filename = %s",
Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/evs/cfe_evs_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,7 @@ int32 CFE_EVS_WriteAppDataFileCmd(const CFE_EVS_WriteAppDataFile_t *data)
/* Create Application Data File */
FileHandle = OS_creat(LocalName, OS_WRITE_ONLY);

if (FileHandle < OS_FS_SUCCESS)
if (FileHandle < OS_SUCCESS)
{
EVS_SendEvent(CFE_EVS_ERR_CRDATFILE_EID, CFE_EVS_EventType_ERROR,
"Write App Data Command Error: OS_creat = 0x%08X, filename = %s",
Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/fs/cfe_fs_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ int32 CFE_FS_SetTimestamp(int32 FileDes, CFE_TIME_SysTime_t NewTimestamp)

if (Result == sizeof(OutTimestamp.Subseconds))
{
Result = OS_FS_SUCCESS;
Result = OS_SUCCESS;
}
else
{
Expand Down
6 changes: 3 additions & 3 deletions fsw/cfe-core/src/inc/cfe_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -808,12 +808,12 @@
#define CFE_OS_ERR_INVALID_PRIORITY (OS_ERR_INVALID_PRIORITY) /**< @copydoc OS_ERR_INVALID_PRIORITY */
#define CFE_OS_ERROR_TASK_ID (OS_ERROR_TASK_ID) /**< @brief This doesn't actually exist */
#define CFE_OS_SEM_UNAVAILABLE (OS_SEM_UNAVAILABLE) /**< @brief This doesn't actually exist */
#define CFE_OS_FS_ERROR (OS_FS_ERROR) /**< @copydoc OS_FS_ERROR */
#define CFE_OS_FS_ERR_INVALID_POINTER (OS_FS_ERR_INVALID_POINTER) /**< @copydoc OS_FS_ERR_INVALID_POINTER */
#define CFE_OS_ERROR (OS_ERROR) /**< @copydoc OS_ERROR */
#define CFE_OS_INVALID_POINTER (OS_INVALID_POINTER) /**< @copydoc OS_INVALID_POINTER */
#define CFE_OS_FS_ERR_PATH_TOO_LONG (OS_FS_ERR_PATH_TOO_LONG) /**< @copydoc OS_FS_ERR_PATH_TOO_LONG */
#define CFE_OS_FS_ERR_NAME_TOO_LONG (OS_FS_ERR_NAME_TOO_LONG) /**< @copydoc OS_FS_ERR_NAME_TOO_LONG */
#define CFE_OS_FS_ERR_DRIVE_NOT_CREATED (OS_FS_ERR_DRIVE_NOT_CREATED) /**< @copydoc OS_FS_ERR_DRIVE_NOT_CREATED */
#define CFE_OSAPI_NOT_IMPLEMENTED (OS_FS_UNIMPLEMENTED) /**< @copydoc OS_FS_UNIMPLEMENTED */
#define CFE_OSAPI_NOT_IMPLEMENTED (OS_ERR_NOT_IMPLEMENTED) /**< @copydoc OS_ERR_NOT_IMPLEMENTED */

/*
************* SOFTWARE BUS SERVICES STATUS CODES *************
Expand Down
6 changes: 3 additions & 3 deletions fsw/cfe-core/src/sb/cfe_sb_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ int32 CFE_SB_SendRtgInfo(const char *Filename)
CFE_SB_DestinationD_t *DestPtr;

fd = OS_creat(Filename, OS_WRITE_ONLY);
if(fd < OS_FS_SUCCESS){
if(fd < OS_SUCCESS){
CFE_EVS_SendEvent(CFE_SB_SND_RTG_ERR1_EID,CFE_EVS_EventType_ERROR,
"Error creating file %s, stat=0x%x",
Filename,(unsigned int)fd);
Expand Down Expand Up @@ -953,7 +953,7 @@ int32 CFE_SB_SendPipeInfo(const char *Filename)

fd = OS_creat(Filename, OS_WRITE_ONLY);

if(fd < OS_FS_SUCCESS){
if(fd < OS_SUCCESS){
CFE_EVS_SendEvent(CFE_SB_SND_RTG_ERR1_EID,CFE_EVS_EventType_ERROR,
"Error creating file %s, stat=0x%x",
Filename,(unsigned int)fd);
Expand Down Expand Up @@ -1028,7 +1028,7 @@ int32 CFE_SB_SendMapInfo(const char *Filename)

fd = OS_creat(Filename, OS_WRITE_ONLY);

if (fd < OS_FS_SUCCESS){
if (fd < OS_SUCCESS){
CFE_EVS_SendEvent(CFE_SB_SND_RTG_ERR1_EID,CFE_EVS_EventType_ERROR,
"Error creating file %s, stat=0x%x",
Filename,(unsigned int)fd);
Expand Down
6 changes: 3 additions & 3 deletions fsw/cfe-core/src/tbl/cfe_tbl_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,12 @@ int32 CFE_TBL_GetWorkingBuffer(CFE_TBL_LoadBuff_t **WorkingBufferPtr,
** of table image file to be loaded
**
** \retval #CFE_SUCCESS \copydoc CFE_SUCCESS
** \retval #OS_FS_ERR_INVALID_POINTER \copydoc OS_FS_ERR_INVALID_POINTER
** \retval #OS_INVALID_POINTER \copydoc OS_INVALID_POINTER
** \retval #OS_FS_ERR_PATH_TOO_LONG \copydoc OS_FS_ERR_PATH_TOO_LONG
** \retval #OS_FS_ERR_PATH_INVALID \copydoc OS_FS_ERR_PATH_INVALID
** \retval #OS_FS_ERR_NAME_TOO_LONG \copydoc OS_FS_ERR_NAME_TOO_LONG
** \retval #OS_FS_ERR_NO_FREE_FDS \copydoc OS_FS_ERR_NO_FREE_FDS
** \retval #OS_FS_ERROR \copydoc OS_FS_ERROR
** \retval #OS_ERR_NO_FREE_IDS \copydoc OS_ERR_NO_FREE_IDS
** \retval #OS_ERROR \copydoc OS_ERROR
** \retval #CFE_TBL_ERR_FILE_TOO_LARGE \copydoc CFE_TBL_ERR_FILE_TOO_LARGE
** \retval #CFE_TBL_WARN_SHORT_FILE \copydoc CFE_TBL_WARN_SHORT_FILE
** \retval #CFE_TBL_WARN_PARTIAL_LOAD \copydoc CFE_TBL_WARN_PARTIAL_LOAD
Expand Down
6 changes: 3 additions & 3 deletions fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ int32 CFE_TBL_HousekeepingCmd(const CCSDS_CommandPacket_t *data)
{
Status = CFE_FS_SetTimestamp(FileDescriptor, DumpTime);

if (Status != OS_FS_SUCCESS)
if (Status != OS_SUCCESS)
{
CFE_ES_WriteToSysLog("CFE_TBL:HkCmd-Unable to update timestamp in dump file '%s'\n",
DumpCtrlPtr->DumpBufferPtr->DataSource);
Expand Down Expand Up @@ -757,7 +757,7 @@ CFE_TBL_CmdProcRet_t CFE_TBL_DumpToFile( const char *DumpFilename, const char *T
/* Create a new dump file, overwriting anything that may have existed previously */
FileDescriptor = OS_creat(DumpFilename, OS_WRITE_ONLY);

if (FileDescriptor >= OS_FS_SUCCESS)
if (FileDescriptor >= OS_SUCCESS)
{
/* Initialize the standard cFE File Header for the Dump File */
CFE_FS_InitHeader(&StdFileHeader, "Table Dump Image", CFE_FS_SubType_TBL_IMG);
Expand Down Expand Up @@ -1147,7 +1147,7 @@ int32 CFE_TBL_DumpRegistryCmd(const CFE_TBL_DumpRegistry_t *data)
/* Create a new dump file, overwriting anything that may have existed previously */
FileDescriptor = OS_creat(DumpFilename, OS_WRITE_ONLY);

if (FileDescriptor >= OS_FS_SUCCESS)
if (FileDescriptor >= OS_SUCCESS)
{
/* Initialize the standard cFE File Header for the Dump File */
CFE_FS_InitHeader(&StdFileHeader, "Table Registry", CFE_FS_SubType_TBL_REG);
Expand Down
6 changes: 3 additions & 3 deletions fsw/cfe-core/unit-test/es_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -3054,7 +3054,7 @@ void TestTask(void)
/* Test write of all app data to file with a write header failure */
ES_ResetUnitTest();
memset(&CmdBuf, 0, sizeof(CmdBuf));
UT_SetDeferredRetcode(UT_KEY(CFE_FS_WriteHeader), 1, OS_FS_ERROR);
UT_SetDeferredRetcode(UT_KEY(CFE_FS_WriteHeader), 1, OS_ERROR);
UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CFE_ES_QueryAll_t),
UT_TPID_CFE_ES_CMD_QUERY_ALL_CC);
UT_Report(__FILE__, __LINE__,
Expand Down Expand Up @@ -3231,7 +3231,7 @@ void TestTask(void)

/* Test writing the system log with a write header failure */
ES_ResetUnitTest();
UT_SetDeferredRetcode(UT_KEY(CFE_FS_WriteHeader), 1, OS_FS_ERROR);
UT_SetDeferredRetcode(UT_KEY(CFE_FS_WriteHeader), 1, OS_ERROR);
UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CFE_ES_WriteSyslog_t),
UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC);
UT_Report(__FILE__, __LINE__,
Expand Down Expand Up @@ -3290,7 +3290,7 @@ void TestTask(void)
/* Test writing the E&R log with a write header failure */
ES_ResetUnitTest();
memset(&CmdBuf, 0, sizeof(CmdBuf));
UT_SetDeferredRetcode(UT_KEY(CFE_FS_WriteHeader), 1, OS_FS_ERROR);
UT_SetDeferredRetcode(UT_KEY(CFE_FS_WriteHeader), 1, OS_ERROR);
UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CFE_ES_WriteERLog_t),
UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC);
UT_Report(__FILE__, __LINE__,
Expand Down
14 changes: 7 additions & 7 deletions fsw/cfe-core/unit-test/fs_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void Test_CFE_FS_ReadHeader(void)

/* Test successfully reading the header */
UT_InitData();
UT_SetDeferredRetcode(UT_KEY(OS_lseek), 1, OS_FS_SUCCESS);
UT_SetDeferredRetcode(UT_KEY(OS_lseek), 1, OS_SUCCESS);
UT_SetForceFail(UT_KEY(OS_read), OS_ERROR);
UT_Report(__FILE__, __LINE__,
CFE_FS_ReadHeader(&Hdr, FileDes) != sizeof(CFE_FS_Header_t),
Expand Down Expand Up @@ -142,10 +142,10 @@ void Test_CFE_FS_WriteHeader(void)

/* Test successfully writing the header */
UT_InitData();
UT_SetDeferredRetcode(UT_KEY(OS_lseek), 1, OS_FS_SUCCESS);
UT_SetDeferredRetcode(UT_KEY(OS_write), 1, OS_FS_SUCCESS);
UT_SetDeferredRetcode(UT_KEY(OS_lseek), 1, OS_SUCCESS);
UT_SetDeferredRetcode(UT_KEY(OS_write), 1, OS_SUCCESS);
UT_Report(__FILE__, __LINE__,
CFE_FS_WriteHeader(FileDes, &Hdr) == OS_FS_SUCCESS,
CFE_FS_WriteHeader(FileDes, &Hdr) == OS_SUCCESS,
"CFE_FS_WriteHeader",
"Header write - successful");
}
Expand All @@ -166,7 +166,7 @@ void Test_CFE_FS_SetTimestamp(void)
UT_InitData();
UT_SetForceFail(UT_KEY(OS_lseek), OS_ERROR);
UT_Report(__FILE__, __LINE__,
CFE_FS_SetTimestamp(FileDes, NewTimestamp) == OS_FS_ERROR,
CFE_FS_SetTimestamp(FileDes, NewTimestamp) == OS_ERROR,
"CFE_FS_SetTimestamp",
"Failed to lseek time fields");

Expand All @@ -189,7 +189,7 @@ void Test_CFE_FS_SetTimestamp(void)
/* Test successfully setting the time stamp */
UT_InitData();
UT_Report(__FILE__, __LINE__,
CFE_FS_SetTimestamp(FileDes, NewTimestamp) == OS_FS_SUCCESS,
CFE_FS_SetTimestamp(FileDes, NewTimestamp) == OS_SUCCESS,
"CFE_FS_SetTimestamp",
"Write time stamp - successful");
}
Expand Down Expand Up @@ -506,7 +506,7 @@ void Test_CFE_FS_Decompress(void)
/* Test filling the input buffer with a FS error */
UT_InitData();
UT_SetDeferredRetcode(UT_KEY(OS_read), 1, 4);
UT_SetDeferredRetcode(UT_KEY(OS_read), 1, OS_FS_ERROR);
UT_SetDeferredRetcode(UT_KEY(OS_read), 1, OS_ERROR);
UT_Report(__FILE__, __LINE__,
FS_gz_fill_inbuf_Reentrant(&UT_FS_Decompress_State) == EOF,
"FS_gz_fill_inbuf",
Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/unit-test/tbl_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -1761,7 +1761,7 @@ void Test_CFE_TBL_HousekeepingCmd(void)
/* Test response to a file time stamp failure */
UT_InitData();
CFE_TBL_TaskData.DumpControlBlocks[0].State = CFE_TBL_DUMP_PERFORMED;
UT_SetDeferredRetcode(UT_KEY(CFE_FS_SetTimestamp), 1, OS_FS_SUCCESS - 1);
UT_SetDeferredRetcode(UT_KEY(CFE_FS_SetTimestamp), 1, OS_SUCCESS - 1);
UT_Report(__FILE__, __LINE__,
CFE_TBL_HousekeepingCmd(NULL) == CFE_TBL_DONT_INC_CTR,
"CFE_TBL_HousekeepingCmd",
Expand Down
4 changes: 2 additions & 2 deletions fsw/cfe-core/ut-stubs/ut_fs_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,13 @@ int32 CFE_FS_ReadHeader(CFE_FS_Header_t *Hdr, int32 FileDes)
** being called. If the value FSSetTimestampRtn.count is greater than
** zero then the counter is decremented; if it then equals zero the
** return value is set to the user-defined value
** FSSetTimestampRtn.value. OS_FS_SUCCESS is returned otherwise.
** FSSetTimestampRtn.value. OS_SUCCESS is returned otherwise.
**
** \par Assumptions, External Events, and Notes:
** None
**
** \returns
** Returns either a user-defined status flag or OS_FS_SUCCESS.
** Returns either a user-defined status flag or OS_SUCCESS.
**
******************************************************************************/
int32 CFE_FS_SetTimestamp(int32 FileDes, CFE_TIME_SysTime_t NewTimestamp)
Expand Down

0 comments on commit 38f035f

Please sign in to comment.