-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
comm: report all I/O errors #9086
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
base: main
Are you sure you want to change the base?
Conversation
|
GNU testsuite comparison: |
CodSpeed Performance ReportMerging this PR will degrade performance by 3.26%Comparing Summary
Performance Changes
Footnotes
|
ad54136 to
d9f4f19
Compare
|
GNU testsuite comparison: |
d9f4f19 to
6bc9f47
Compare
|
For Windows I decided to stick with the same behavior of Unix: report the error from the operating system. In the case of Windows, if the file is a directory, you get "permission denied". Not very user friendly, but I think this is the best approach, mostly because it's not racy. If the maintainers don't like that, we can add a metadata check just for Windows (not on Unix), maybe something like: try to open the file, if it fails with a "permission denied", check if it's a directory, and based on that report the most appropriate error message. Let me know what you prefer and I will update the PR accordingly. |
|
GNU testsuite comparison: |
I/O errors were being silently suppressed. This also removes an unnecessary check to see if one of the inputs is a directory.
6bc9f47 to
4bfa498
Compare
|
GNU testsuite comparison: |
If a read error happens after opening the file, that error is never reported and
commjust quits without printing any error message. This commit fixes that.This also removes the
is_dir()check, preventing a potential race condition where the path could be swapped with a directory in between theis_dir()check and theopen()call. On Unix, this correctly results in the "is a directory" error message to be printed (this is detected atread()time).