Skip to content

Fix return type of system_close_on_exec= on Windows#16095

Merged
straight-shoota merged 1 commit intocrystal-lang:masterfrom
straight-shoota:fix/close_on_exec-windows
Aug 17, 2025
Merged

Fix return type of system_close_on_exec= on Windows#16095
straight-shoota merged 1 commit intocrystal-lang:masterfrom
straight-shoota:fix/close_on_exec-windows

Conversation

@straight-shoota
Copy link
Member

#system_close_on_exec= (and thus #close_on_exec=) returns Nil on Windows. But #15698 added a type-restriction to Bool. We didn't notice this discrepancy before, because this method was never called on Windows until we enabled the specs for that in #14716.

Changing the return value to false on Windows should be the correct behaviour. If the parameter is true, the method raises.

This is a classic integration issue. It could've been avoided by testing each change against current master directly before merging it. But luckily they are pretty rare, so there's no urgent need to do something about it.

@straight-shoota straight-shoota self-assigned this Aug 16, 2025
@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:system labels Aug 16, 2025
@straight-shoota straight-shoota changed the title Fix return type of system_close_on_exec= on Windows [fixup #15698] Fix return type of system_close_on_exec= on Windows Aug 16, 2025
@straight-shoota straight-shoota added this to the 1.18.0 milestone Aug 17, 2025
@straight-shoota straight-shoota merged commit 768178a into crystal-lang:master Aug 17, 2025
41 checks passed
@straight-shoota straight-shoota deleted the fix/close_on_exec-windows branch August 17, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants