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

kqueue: set proper errno for no threadpool, handle errnos properly #57

Merged
merged 1 commit into from
Aug 6, 2023

Conversation

mitchellh
Copy link
Owner

Fixes #54

This fixes a few issues:

  1. When an operation requesting a threadpool is registered with a loop that has no threadpool, we set the result to EPERM. We were forgetting to negate the result so we were seeing it as a success.

  2. We used errno() to process results, but for manually constructed errnos (like the above), we'd read an invalid value because we don't actually set the errno threadlocal... and don't want to.

  3. We didn't have cancellation and permission denied as part of the error sets because we never hit them! Now we do! As we should.

Fixes #54

This fixes a few issues:

  1. When an operation requesting a threadpool is registered with a loop
     that has no threadpool, we set the result to EPERM. We were
     forgetting to negate the result so we were seeing it as a success.

  2. We used `errno()` to process results, but for manually constructed
     errnos (like the above), we'd read an invalid value because we
     don't actually set the errno threadlocal... and don't want to.

  3. We didn't have cancellation and permission denied as part of the
     error sets because we never hit them! Now we do! As we should.
@mitchellh mitchellh changed the title set proper errno for no threadpool, handle errnos properly kqueue: set proper errno for no threadpool, handle errnos properly Aug 6, 2023
@mitchellh mitchellh merged commit d79c54c into main Aug 6, 2023
16 checks passed
@mitchellh mitchellh deleted the errno-darwin branch August 6, 2023 18:29
@penberg
Copy link
Contributor

penberg commented Aug 6, 2023

Cool, thanks for the quick fix @mitchellh!

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.

Reading exactly N bytes from a file?
2 participants