summaryrefslogtreecommitdiff
path: root/src/sys/select.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/select.rs')
-rw-r--r--src/sys/select.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/sys/select.rs b/src/sys/select.rs
index 5cae88fd..db0a55b9 100644
--- a/src/sys/select.rs
+++ b/src/sys/select.rs
@@ -1,8 +1,7 @@
use std::ptr::null_mut;
use std::os::unix::io::RawFd;
use libc::c_int;
-use {Result, Error};
-use errno::Errno;
+use errno::{Errno, Result};
use sys::time::TimeVal;
pub const FD_SETSIZE: RawFd = 1024;
@@ -82,9 +81,5 @@ pub fn select(nfds: c_int,
ffi::select(nfds, readfds, writefds, errorfds, timeout)
};
- if res == -1 {
- Err(Error::Sys(Errno::last()))
- } else {
- Ok(res)
- }
+ Errno::result(res)
}