summaryrefslogtreecommitdiff
path: root/src/sys/select.rs
diff options
context:
space:
mode:
authorarcnmx <arcnmx@users.noreply.github.com>2016-01-25 21:57:17 -0500
committerKamal Marhubi <kamal@marhubi.com>2016-01-28 00:44:44 -0500
commit136bb454d98a9032843259e71f12d8e33cd90f27 (patch)
tree942872a1bad2de7b3417f248dda6d70b8ac01d54 /src/sys/select.rs
parent01e841679633b459470120a305ff22dd12138422 (diff)
downloadnix-136bb454d98a9032843259e71f12d8e33cd90f27.zip
Errno::result()
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)
}