Skip to content

Commit

Permalink
Fix nasa#1442, Simplify CFE_FS_SetTimestamp and fix syslog typo
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed May 21, 2021
1 parent 8443a46 commit 0634c1e
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions modules/fs/fsw/src/cfe_fs_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,25 +293,16 @@ int32 CFE_FS_SetTimestamp(osal_id_t FileDes, CFE_TIME_SysTime_t NewTimestamp)
CFE_FS_ByteSwapUint32(&OutTimestamp.Subseconds);
}

Result = OS_write(FileDes, &OutTimestamp.Seconds, sizeof(OutTimestamp.Seconds));
Result = OS_write(FileDes, &OutTimestamp, sizeof(OutTimestamp));

/* On a good write, the value returned will equal the number of bytes written */
if (Result == sizeof(OutTimestamp.Seconds))
if (Result == sizeof(OutTimestamp))
{
Result = OS_write(FileDes, &OutTimestamp.Subseconds, sizeof(OutTimestamp.Subseconds));

if (Result == sizeof(OutTimestamp.Subseconds))
{
Result = OS_SUCCESS;
}
else
{
CFE_ES_WriteToSysLog("CFE_FS:SetTime-Failed to write Seconds (Status=0x%08X)\n", (unsigned int)Result);
}
Result = OS_SUCCESS;
}
else
{
CFE_ES_WriteToSysLog("CFE_FS:SetTime-Failed to write Seconds (Status=0x%08X)\n", (unsigned int)Result);
CFE_ES_WriteToSysLog("%s(): Failed to write timestamp (Status=0x%08X)\n", __func__, (unsigned int)Result);
}
}
else
Expand Down

0 comments on commit 0634c1e

Please sign in to comment.