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

Cleanup epoll_create fallback #1594

Merged
merged 2 commits into from
Jul 17, 2022

Conversation

Thomasdezeeuw
Copy link
Collaborator

Now allows the fallback on all platforms, if we doing one why not all?

Also properly closes the file descriptor if the fcntl call fails.

Follow up to #1590.

Not required, Make handles this for us.
Now allows the fallback on all platforms, if we doing one why not all?

Also properly closes the file descriptor if the fcntl call fails.
@Thomasdezeeuw Thomasdezeeuw merged commit 7ba07b5 into tokio-rs:master Jul 17, 2022
@Thomasdezeeuw Thomasdezeeuw deleted the epoll_cleanup branch July 17, 2022 21:44
// 21. But `EPOLL_CLOEXEC` is an alias for `O_CLOEXEC` on that platform,
// so we use it instead.
#[cfg(target_os = "android")]
let res = syscall!(syscall(libc::SYS_epoll_create1, libc::EPOLL_CLOEXEC));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was EPOLL_CLOEXEC on non-android and O_CLOEXEC fallback on android, but after this PR it's reversed. I think it should be O_CLOEXEC on this line and EPOLL_CLOEXEC above (for epoll_create1).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, created #1595.

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.

3 participants