diff --git a/src/poll.rs b/src/poll.rs index e276090eb2..58d03e44c6 100644 --- a/src/poll.rs +++ b/src/poll.rs @@ -133,13 +133,17 @@ pub fn poll(fds: &mut [PollFd], timeout: libc::c_int) -> Result { /// with the `sigmask` argument. /// #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", target_os = "linux"))] -pub fn ppoll(fds: &mut [PollFd], timeout: TimeSpec, sigmask: SigSet) -> Result { - +pub fn ppoll(fds: &mut [PollFd], timeout: Option, sigmask: SigSet) -> Result { + let timeout = &timeout; + let timeout = match timeout { + Some(t) => t.as_ref(), + None => core::ptr::null() + }; let res = unsafe { libc::ppoll(fds.as_mut_ptr() as *mut libc::pollfd, fds.len() as libc::nfds_t, - timeout.as_ref(), + timeout, sigmask.as_ref()) }; Errno::result(res)