cat,comm,expand,unexpand: remove is_dir() pre-checks to let read() report errors#10891
Draft
ChrisDryden wants to merge 1 commit intouutils:mainfrom
Draft
cat,comm,expand,unexpand: remove is_dir() pre-checks to let read() report errors#10891ChrisDryden wants to merge 1 commit intouutils:mainfrom
ChrisDryden wants to merge 1 commit intouutils:mainfrom
Conversation
Collaborator
Author
|
Hmm I have to figure out what to do for windows here, this is not defined behavior compared to GNU |
Merging this PR will degrade performance by 4.75%
Performance Changes
Comparing Footnotes
|
|
GNU testsuite comparison: |
Collaborator
Author
|
It looks like the fix here is to make the is_dir checks a windows only thing instead of removing it entirely |
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.
This PR is based on the investigation of the read-error gnu test failures. Even though we correctly identify that the test is trying to use a directory we are failing the test because the error coming from the read function is different. This led me down the path to discover that we actually do not need to do additional stat checks to check if we are trying to read a directory because that is handled by read() and it is the expectation that we rely on the read() checks to provide the error message.
Every utility in this PR already had integration tests for validating that the error message matches the GNU error message and I have made them more exact by also validating error code and making it stderr_is instead of stderr_contains.
There will probably be two more PR's basically the same as this one for the other utilities