Skip to content

socket closed after UnixStream::into_raw_fd() #855

Closed
@yshui

Description

@yshui

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions