-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
cat: Changes to ENOSPC Handling #9933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mattsu2020
wants to merge
6
commits into
uutils:main
Choose a base branch
from
mattsu2020:cat_9920
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+94
−48
Conversation
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
- Introduce WriteError variant in CatError enum to specifically handle stdout write failures - Add map_write_err helper to wrap io::Result into CatResult with WriteError - Update cat_files to catch WriteError early and report using localized message - Wrap write_all and flush calls in write_fast and write_lines with map_write_err - Add localized error messages for "write error" in en-US and fr-FR locales This improves error reporting for I/O issues like broken pipes during output.
…ite_nonprint_to_end Removed a trailing semicolon following the match arms in the `write_nonprint_to_end` function, which was likely causing a compiler warning or style issue in Rust. This ensures cleaner code without altering functionality.
- Adds a new test case to verify that `cat /dev/stdin` properly handles writing to a full device (/dev/full) and outputs the correct error message "No space left on device" without the raw errno code. This improves test coverage for error handling on Unix-like systems.
- Prevents spell-checker from flagging ENOSPC as a misspelling, as it's a valid errno constant (e.g., "No space left on device") used in the test code.
Contributor
|
I did not know that we have our own error messages instead of extracting from OS. |
|
GNU testsuite comparison: |
Contributor
|
@mattsu2020 FYI, the "merge branch" just makes review slower ;) |
Contributor
Author
sorry |
|
GNU testsuite comparison: |
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.
To align with GNU coreutils behavior
Changes to ENOSPC handling
related
#9920