Skip to content

Fix #855 - #856

Merged
yoshuawuyts merged 2 commits into
async-rs:masterfrom
yshui:master
Aug 28, 2020
Merged

yoshuawuyts merged 2 commits into
async-rs:masterfrom
yshui:master

Conversation

@yshui

@yshui yshui commented Aug 18, 2020

Copy link
Copy Markdown
Contributor

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]>

@yoshuawuyts yoshuawuyts left a comment

Copy link
Copy Markdown
Contributor

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