summaryrefslogtreecommitdiff
path: root/src/sched.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sched.rs')
-rw-r--r--src/sched.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sched.rs b/src/sched.rs
index 69436fdf..c2dd7b84 100644
--- a/src/sched.rs
+++ b/src/sched.rs
@@ -15,7 +15,7 @@ mod sched_linux_like {
use std::option::Option;
use std::os::unix::io::RawFd;
use crate::unistd::Pid;
- use crate::{Error, Result};
+ use crate::Result;
// For some functions taking with a parameter of type CloneFlags,
// only a subset of these flags have an effect.
@@ -109,7 +109,7 @@ mod sched_linux_like {
/// `field` is the CPU id to test
pub fn is_set(&self, field: usize) -> Result<bool> {
if field >= CpuSet::count() {
- Err(Error::from(Errno::EINVAL))
+ Err(Errno::EINVAL)
} else {
Ok(unsafe { libc::CPU_ISSET(field, &self.cpu_set) })
}
@@ -119,7 +119,7 @@ mod sched_linux_like {
/// `field` is the CPU id to add
pub fn set(&mut self, field: usize) -> Result<()> {
if field >= CpuSet::count() {
- Err(Error::from(Errno::EINVAL))
+ Err(Errno::EINVAL)
} else {
unsafe { libc::CPU_SET(field, &mut self.cpu_set); }
Ok(())
@@ -130,7 +130,7 @@ mod sched_linux_like {
/// `field` is the CPU id to remove
pub fn unset(&mut self, field: usize) -> Result<()> {
if field >= CpuSet::count() {
- Err(Error::from(Errno::EINVAL))
+ Err(Errno::EINVAL)
} else {
unsafe { libc::CPU_CLR(field, &mut self.cpu_set);}
Ok(())