Skip to content

wc: replace File::from_raw_fd with nix::sys::stat #11248

Merged
cakebaker merged 1 commit intouutils:mainfrom
mattsu2020:wc_refactoring
Mar 9, 2026
Merged

wc: replace File::from_raw_fd with nix::sys::stat #11248
cakebaker merged 1 commit intouutils:mainfrom
mattsu2020:wc_refactoring

Conversation

@mattsu2020
Copy link
Contributor

Replace the unsafe File::from_raw_fd approach with nix::sys::stat::fstat for checking if stdin is a small file. This change improves safety by avoiding manual file descriptor management and using the nix crate's safer interface for file statistics.

…in size check

Replace the unsafe File::from_raw_fd approach with nix::sys::stat::fstat for checking if stdin is a small file. This change improves safety by avoiding manual file descriptor management and using the nix crate's safer interface for file statistics.
@github-actions
Copy link

github-actions bot commented Mar 9, 2026

GNU testsuite comparison:

Congrats! The gnu test tests/csplit/csplit-heap is now passing!
Congrats! The gnu test tests/rm/many-dir-entries-vs-OOM is now passing!

@cakebaker cakebaker merged commit 53200b3 into uutils:main Mar 9, 2026
158 of 160 checks passed
@cakebaker
Copy link
Contributor

Thanks!

@mattsu2020 mattsu2020 deleted the wc_refactoring branch March 9, 2026 23:09
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