Skip to content

Commit 9876979

Browse files
committed
select: allow infinite timeout
1 parent 94ea763 commit 9876979

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sys/select.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ pub fn select(nfds: c_int,
7171
readfds: Option<&mut FdSet>,
7272
writefds: Option<&mut FdSet>,
7373
errorfds: Option<&mut FdSet>,
74-
timeout: &mut TimeVal) -> Result<c_int> {
74+
timeout: Option<&mut TimeVal>) -> Result<c_int> {
7575
let readfds = readfds.map(|set| set as *mut FdSet).unwrap_or(null_mut());
7676
let writefds = writefds.map(|set| set as *mut FdSet).unwrap_or(null_mut());
7777
let errorfds = errorfds.map(|set| set as *mut FdSet).unwrap_or(null_mut());
78-
let timeout = timeout as *mut TimeVal;
78+
let timeout = timeout.map(|tv| tv as *mut TimeVal).unwrap_or(null_mut());
7979

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

0 commit comments

Comments
 (0)