Repository navigation
Fix os9 copy exit status and add regression coverage - #89
Merged
DrPitre merged 1 commit intoOct 29, 2026
Merged
Conversation
os9 copy printed errors from TSCopyFile but unconditionally returned zero, so callers and scripts could not distinguish a failed copy from success. Returning only the last copy result would also hide an earlier failure when processing multiple sources. Track the first nonzero copy error in os9/os9copy.c and return it after processing all sources and freeing the copy buffer. Continue attempting remaining sources so a missing file does not prevent valid files from being copied. Add test_os9_command_copy_exit_status in unittest/os9commandtest.c using a self-contained OS-9 disk image and native source fixture. Verify: - Successful copies exit with zero. - Missing sources return EOS_PNNF. - Existing destinations without -r return EOS_FAE. - Multi-source failures remain visible before or after a successful copy. - A valid source following a failed source is copied with exact contents. Validation: - Confirmed the regression failed before the fix: a missing source incorrectly returned exit status zero. - make -C build/unix succeeded; all 55 tests passed. - git diff --check passed.
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.
os9 copy printed errors from TSCopyFile but unconditionally returned zero, so callers and scripts could not distinguish a failed copy from success. Returning only the last copy result would also hide an earlier failure when processing multiple sources.
Track the first nonzero copy error in os9/os9copy.c and return it after processing all sources and freeing the copy buffer. Continue attempting remaining sources so a missing file does not prevent valid files from being copied.
Add test_os9_command_copy_exit_status in unittest/os9commandtest.c using a self-contained OS-9 disk image and native source fixture. Verify:
Validation: