-
Notifications
You must be signed in to change notification settings - Fork 20
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 #5, Remove OS_OpenCreate
file status check in SC_LoadDefaultTables
#81
Fix #5, Remove OS_OpenCreate
file status check in SC_LoadDefaultTables
#81
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced this check should even be in there at all - no matter which function is used, its a race condition, due to the difference between the time of check and time of use.
That is, CFE_TBL_Load()
will open the file again, and it should handle the error if it is not able to open it. SC should just check for that possible result - it shouldn't do its own check to avoid that result, because any such attempt would be incomplete and a race condition.
As this change set stands right now, while OS_stat()
is lighter weight, it only verifies that the file exists, it does not verify that the file is readable.
I think we should simplify this, and remove this extra check.
fae737a
to
895d3fb
Compare
OS_OpenCreate
file status check in SC_LoadDefaultTables
Great! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this simplification, but we need to check if this affects any of the build verification tests.
I think we should merge it but we need to note this may need a corresponding test update to go with it.
95d63ac
to
77b34c7
Compare
77b34c7
to
00a7577
Compare
Thanks for the update, I still think we should merge this one. Will bring it up at the next review. |
Checklist
Describe the contribution
OS_OpenCreate()
in theSC_LoadDefaultTables()
function converted toOS_stat()
.Testing performed
GitHub CI actions (incl. Build + Run, Unit Tests etc.) all passing successfully.
Expected behavior changes
Simplifies function and eases future maintenance.
Contributor Info
Avi Weiss @thnkslprpt