Skip to content

refactor(head): replace unsafe raw fd usage with safe AsFd API#10161

Merged
sylvestre merged 1 commit intouutils:mainfrom
mattsu2020:head_refactoring
Jan 10, 2026
Merged

refactor(head): replace unsafe raw fd usage with safe AsFd API#10161
sylvestre merged 1 commit intouutils:mainfrom
mattsu2020:head_refactoring

Conversation

@mattsu2020
Copy link
Contributor

Summary

Use std::os::fd::AsFd trait and try_clone_to_owned to safely handle stdin file descriptor, eliminating unsafe code for better reliability and adherence to modern Rust standards.

Use std::os::fd::AsFd trait and try_clone_to_owned to safely handle stdin file descriptor, eliminating unsafe code for better reliability and adherence to modern Rust standards.
@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/stty/bad-speed is now passing!

@sylvestre sylvestre merged commit cb6d339 into uutils:main Jan 10, 2026
132 checks passed
@mattsu2020 mattsu2020 deleted the head_refactoring branch January 11, 2026 23:23
mattsu2020 added a commit to mattsu2020/coreutils that referenced this pull request Jan 23, 2026
…s#10161)

Use std::os::fd::AsFd trait and try_clone_to_owned to safely handle stdin file descriptor, eliminating unsafe code for better reliability and adherence to modern Rust standards.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants