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

socket closed after UnixStream::into_raw_fd() #855

Closed
yshui opened this issue Aug 18, 2020 · 1 comment
Closed

socket closed after UnixStream::into_raw_fd() #855

yshui opened this issue Aug 18, 2020 · 1 comment

Comments

@yshui
Copy link
Contributor

yshui commented Aug 18, 2020

impl IntoRawFd for UnixStream {
fn into_raw_fd(self) -> RawFd {
self.as_raw_fd()
}
}

.as_raw_fd doesn't take the ownership of the fd, so the fd is closed when self is dropped. This was #147 , which was fixed, then apparently reintroduced.

I thought I added a test case to catch this....

@yshui
Copy link
Contributor Author

yshui commented Aug 18, 2020

Ah, the test case only covers UnixDatagram. I could've done better..

yoshuawuyts added a commit that referenced this issue 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

No branches or pull requests

1 participant