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

Refactor CFE_FS_SetTimestamp and eliminate typo #1442

Closed
skliper opened this issue Apr 28, 2021 · 0 comments · Fixed by #1566 or #1619
Closed

Refactor CFE_FS_SetTimestamp and eliminate typo #1442

skliper opened this issue Apr 28, 2021 · 0 comments · Fixed by #1566 or #1619

Comments

@skliper
Copy link
Contributor

skliper commented Apr 28, 2021

Is your feature request related to a problem? Please describe.
There's a typo in one of the syslogs:

CFE_ES_WriteToSysLog("CFE_FS:SetTime-Failed to write Seconds (Status=0x%08X)\n", (unsigned int)Result);

Also could just write the time structure instead of seconds and then subseconds:

Result = OS_write(FileDes, &OutTimestamp.Seconds, sizeof(OutTimestamp.Seconds));
/* On a good write, the value returned will equal the number of bytes written */
if (Result == sizeof(OutTimestamp.Seconds))
{
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);
}
}
else
{
CFE_ES_WriteToSysLog("CFE_FS:SetTime-Failed to write Seconds (Status=0x%08X)\n", (unsigned int)Result);
}

Describe the solution you'd like
Write time structure, one syslog with an updated message.

Describe alternatives you've considered
None

Additional context
Code review

Requester Info
Jacob Hageman - NASA/GSFC

@skliper skliper added this to the 7.0.0 milestone Apr 28, 2021
skliper added a commit to skliper/cFE that referenced this issue Jun 1, 2021
 - Now returning `CFE_FS_SetTimestamp` success as `CFE_SUCCESS`
 - Updated return documentation for `CFE_FS_WriteHeader` (returns bytes written or error code)
 - `CFE_FS_SetTimestamp` now returns `CFE_STATUS_EXTERNAL_RESOURCE_FAIL` if the write doesn't return the correct bytes written
 - Update coverage test checks
 - Updated the functional test to check for `CFE_SUCCESS` vs `OS_SUCCESS`
 - Updated check of status in `cfe_tbl_task_cmds.c` to `CFE_SUCCESS
skliper added a commit to skliper/cFE that referenced this issue Jun 3, 2021
- Now returning `CFE_FS_SetTimestamp` success as `CFE_SUCCESS`
- `CFE_FS_SetTimestamp` now returns `CFE_STATUS_EXTERNAL_RESOURCE_FAIL` if the write doesn't return the correct bytes written
- Update coverage test checks
- Updated the functional test to check for `CFE_SUCCESS` vs `OS_SUCCESS`
- Updated check of status in `cfe_tbl_task_cmds.c` to `CFE_SUCCESS
astrogeco added a commit that referenced this issue Jun 10, 2021
Fix #1442, Simplify CFE_FS_SetTimestamp and fix syslog typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant