Skip to content

Commit

Permalink
impl AsRawFd for Registry
Browse files Browse the repository at this point in the history
This is needed for POSIX AIO.

Fixes #1407
  • Loading branch information
asomers authored and Thomasdezeeuw committed Dec 1, 2020
1 parent 6a3a766 commit f70daa7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ cfg_os_poll! {
#[cfg(unix)]
impl AsRawFd for Poll {
fn as_raw_fd(&self) -> RawFd {
self.registry.selector.as_raw_fd()
self.registry.as_raw_fd()
}
}

Expand Down Expand Up @@ -636,6 +636,13 @@ impl fmt::Debug for Registry {
}
}

#[cfg(unix)]
impl AsRawFd for Registry {
fn as_raw_fd(&self) -> RawFd {
self.selector.as_raw_fd()
}
}

/// Get access to the `sys::Selector` from `Registry`.
pub(crate) fn selector(registry: &Registry) -> &sys::Selector {
&registry.selector
Expand Down

0 comments on commit f70daa7

Please sign in to comment.