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

Fix #855 #856

Merged
merged 2 commits into from
Aug 28, 2020
Merged

Fix #855 #856

merged 2 commits into from
Aug 28, 2020

Conversation

yshui
Copy link
Contributor

@yshui yshui commented Aug 18, 2020

No description provided.

yshui added 2 commits August 18, 2020 11:10
`UnixStream::into_raw_fd` calls `as_raw_fd`, which doesn't take the
ownership of the file descriptor, so the file descriptor is closed when
`self` is dropped upon returning from the function.

Because `UnixStream` uses a `Arc` to support Clone, there could be an
arbitrary number of instances around. We cannot take ownership of the
descriptor from all of the instances. Therefore we have no choice but to
duplicate the file descriptor and return that.

Fixes async-rs#855

Signed-off-by: Yuxuan Shui <[email protected]>
Copy link
Contributor

@yoshuawuyts yoshuawuyts left a comment

Choose a reason for hiding this comment

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

Thanks heaps!

@yoshuawuyts yoshuawuyts merged commit bd29747 into async-rs:master Aug 28, 2020
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.

2 participants