fix(checksum): handle stdout write errors gracefully instead of panic…#10978
Open
naoNao89 wants to merge 3 commits intouutils:mainfrom
Open
fix(checksum): handle stdout write errors gracefully instead of panic…#10978naoNao89 wants to merge 3 commits intouutils:mainfrom
naoNao89 wants to merge 3 commits intouutils:mainfrom
Conversation
|
GNU testsuite comparison: |
Contributor
|
As per #10536, any functions that now take |
xtqqczze
reviewed
Feb 16, 2026
…king When redirecting output to /dev/full or encountering other write errors, the checksum utilities now exit with code 1 instead of panicking. Changes: - Modified print_legacy_checksum, print_tagged_checksum, and print_untagged_checksum to use stdout.write_all with error propagation - Added graceful exit with code 1 on write failure (matches GNU behavior) Fixes uutils#10947
49f72b6 to
8624081
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
…and write_tagged_checksum
xtqqczze
approved these changes
Feb 17, 2026
Contributor
xtqqczze
left a comment
There was a problem hiding this comment.
nit: update comments like "Print the filename" to "Write the filename"
|
GNU testsuite comparison: |
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.
I re-implement from existing src/uu/tty stdout error handling
just replace panicking
print!()withwrite!()returningio::Result, propagate errors and exit gracefully with code 1 on write failureFixes #10947.