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.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/sys/select.rs b/src/sys/select.rs
index 1060d618..5cae88fd 100644
--- a/src/sys/select.rs
+++ b/src/sys/select.rs
@@ -46,6 +46,12 @@ impl FdSet {
let fd = fd as usize;
self.bits[fd / BITS] & (1 << (fd % BITS)) > 0
}
+
+ pub fn clear(&mut self) {
+ for bits in &mut self.bits {
+ *bits = 0
+ }
+ }
}
mod ffi {
@@ -78,7 +84,7 @@ pub fn select(nfds: c_int,
if res == -1 {
Err(Error::Sys(Errno::last()))
- } else {
+ } else {
Ok(res)
- }
+ }
}