Skip to content

Commit

Permalink
select: allow infinite timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
abbradar committed Feb 19, 2016
1 parent 94ea763 commit 9876979
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sys/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ pub fn select(nfds: c_int,
readfds: Option<&mut FdSet>,
writefds: Option<&mut FdSet>,
errorfds: Option<&mut FdSet>,
timeout: &mut TimeVal) -> Result<c_int> {
timeout: Option<&mut TimeVal>) -> Result<c_int> {
let readfds = readfds.map(|set| set as *mut FdSet).unwrap_or(null_mut());
let writefds = writefds.map(|set| set as *mut FdSet).unwrap_or(null_mut());
let errorfds = errorfds.map(|set| set as *mut FdSet).unwrap_or(null_mut());
let timeout = timeout as *mut TimeVal;
let timeout = timeout.map(|tv| tv as *mut TimeVal).unwrap_or(null_mut());

let res = unsafe {
ffi::select(nfds, readfds, writefds, errorfds, timeout)
Expand Down

1 comment on commit 9876979

@kamalmarhubi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good!

Please sign in to comment.