Skip to content
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

treat errno(6) (NXIO) as expected error in openatZ #21983

Merged
merged 1 commit into from
Nov 24, 2024

Conversation

bfreis
Copy link
Contributor

@bfreis bfreis commented Nov 13, 2024

This PR adds explicitly handling of NXIO (errono(6)) to std.posix.openatZ to avoid verbose output when this error occurs.

related to: #18240

@bfreis
Copy link
Contributor Author

bfreis commented Nov 13, 2024

Not sure if error.NoDevice is the best choice here, but I couldn't find anything on OpenError that was more suitable. Would it be better to add something new to OpenError instead?

@squeek502
Copy link
Collaborator

squeek502 commented Nov 14, 2024

Coincidentally, this exact topic came up in a separate recent PR here: #21938

No conclusion about the name of the error has been made yet, so feel free to make suggestions if you have them.

@andrewrk
Copy link
Member

Thanks!

@andrewrk andrewrk merged commit c2db5d9 into ziglang:master Nov 24, 2024
10 checks passed
@alexrp
Copy link
Member

alexrp commented Nov 24, 2024

I'm confused about this PR's relation to #18240; that issue is about write, while this is about openat?

@bfreis
Copy link
Contributor Author

bfreis commented Nov 25, 2024

I'm confused about this PR's relation to #18240; that issue is about write, while this is about openat?

You're right, it's a different operation - the relation I saw was that the "theme" and the type of fix is the same: Zig didn't account for errno 6 being a possible, expected error, and treats it as unexpected by being very verbose about it.

A fix to that other issue would likely be very similar, but on write instead of openat.

@alexrp
Copy link
Member

alexrp commented Nov 25, 2024

Ok, I'll reopen that issue then.

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.

4 participants