fix: add O_NONBLOCK, O_NOCTTY, O_CLOEXEC to SUPPORTED_SYSOPEN_MODES - #413
Draft
toddr-bot wants to merge 1 commit into
Draft
fix: add O_NONBLOCK, O_NOCTTY, O_CLOEXEC to SUPPORTED_SYSOPEN_MODES#413toddr-bot wants to merge 1 commit into
toddr-bot wants to merge 1 commit into
Conversation
sysopen() with O_NONBLOCK fatally croaked because the flag was absent from the SUPPORTED_SYSOPEN_MODES whitelist. These flags are harmless for in-memory mocked files (accept and ignore). O_CLOEXEC is guarded with eval since it is not available on all platforms. Closes cpan-authors#412 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Add
O_NONBLOCK,O_NOCTTY, andO_CLOEXECtoSUPPORTED_SYSOPEN_MODESso thatsysopen()on mocked paths no longer fatally croaks when these common, benign flags are used. These flags have no semantic meaning for in-memory mocked files and are safely accepted and ignored.O_CLOEXECis conditionally included since it is not available on all platforms.Closes #412
Changes
O_NONBLOCK | O_NOCTTY | ( eval { O_CLOEXEC() } // 0 )toSUPPORTED_SYSOPEN_MODESconstant inlib/Test/MockFile.pmO_NONBLOCK,O_NOCTTY,O_CLOEXEC, and the exact reproduction case from issue bug: sysopen() with O_NONBLOCK fatally croaks — flag missing from SUPPORTED_SYSOPEN_MODES #412 (O_WRONLY | O_CREAT | O_EXCL | O_NONBLOCK)Test plan
t/sysopen.tverify each flag individually and in combinationO_CLOEXECtest gracefully skips on platforms where the flag is unavailablefh-ref-leak.tis a pre-existing known failure)Quality Report
Changes: 2 files changed, 41 insertions(+), 1 deletion(-)
Code scan: clean
Tests: failed (4 Failed, 94 test)
Branch hygiene: clean
Generated by Kōan