Repository navigation
Conversation
pranav256
marked this pull request as ready for review
November 20, 2026 03:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
Describe the contribution
Fixes #1612.
OS_mv()can delete the source after a failed destination close becauseOS_cp()still reports success. Return native close errors throughOS_close()andOS_cp()so the fallback move keeps the source.The native descriptor and OSAL ID are still released after close, even on error. Passing that error to
OS_ObjectIdFinalizeDelete()would restore an ID whose native descriptor is already invalid, so cleanup is finalized separately from the returned status. Copy closes both handles and keeps the first error.Testing performed
cmake -S . -B build -DENABLE_UNIT_TESTS=true \ -DOSAL_SYSTEM_BSPTYPE=generic-linux \ -DOSAL_CONFIG_DEBUG_PERMISSIVE_MODE=TRUE cmake --build build -j6 ctest --test-dir build --output-on-failure -j6OS_ERRORand retains it. Repeated failures exceed the file-handle limit without exhausting IDs. The successful-move control passes.git diff --checkpass.Fork checks passed: build, tests and coverage, format, and static analysis. Both OSAL CodeQL and cFS build CodeQL completed successfully.
CodeQL ran on a fork-only CI branch that adds the missing caller permission
security-events: write; its C sources match this PR. The standalone scan has no added findings compared with upstream.Upstream checks are waiting for maintainer approval.
Expected behavior changes
No signature change. Native close errors now reach callers; the OSAL handle is released once native close has been attempted. Copy reports a close failure if no earlier error occurred, which prevents move from removing the source.
System(s) tested on
x86-64 PC; Ubuntu 26.04.1 under WSL2; GCC 15.2.0; CMake 3.31.6. Based on OSAL
devatffc9d26.Additional context
Flight targets and COSMOS were not tested. This does not add fsync or remove partial destinations. CLA completion is still pending.
Third party code
None.
Contributor Info
Pranav (@pranav256), Personal.