summaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/aio.rs6
-rw-r--r--src/sys/ptrace/linux.rs4
-rw-r--r--src/sys/signalfd.rs2
-rw-r--r--src/sys/socket/mod.rs2
-rw-r--r--src/sys/timerfd.rs6
5 files changed, 10 insertions, 10 deletions
diff --git a/src/sys/aio.rs b/src/sys/aio.rs
index f9d1dd87..b63affb8 100644
--- a/src/sys/aio.rs
+++ b/src/sys/aio.rs
@@ -983,13 +983,13 @@ impl<'a> LioCb<'a> {
// aiocb is complete; collect its status and don't resubmit
self.results[i] = Some(a.aio_return_unpinned());
},
- Err(Error(Errno::EAGAIN)) => {
+ Err(Errno::EAGAIN) => {
self.list.push(a as *mut AioCb<'a> as *mut libc::aiocb);
},
- Err(Error(Errno::EINPROGRESS)) => {
+ Err(Errno::EINPROGRESS) => {
// aiocb is was successfully queued; no need to do anything
},
- Err(Error(Errno::EINVAL)) => panic!(
+ Err(Errno::EINVAL) => panic!(
"AioCb was never submitted, or already finalized"),
_ => unreachable!()
}
diff --git a/src/sys/ptrace/linux.rs b/src/sys/ptrace/linux.rs
index 3ac48097..4ac43936 100644
--- a/src/sys/ptrace/linux.rs
+++ b/src/sys/ptrace/linux.rs
@@ -2,7 +2,7 @@
use cfg_if::cfg_if;
use std::{mem, ptr};
-use crate::{Error, Result};
+use crate::Result;
use crate::errno::Errno;
use libc::{self, c_void, c_long, siginfo_t};
use crate::unistd::Pid;
@@ -180,7 +180,7 @@ fn ptrace_peek(request: Request, pid: Pid, addr: AddressType, data: *mut c_void)
libc::ptrace(request as RequestType, libc::pid_t::from(pid), addr, data)
};
match Errno::result(ret) {
- Ok(..) | Err(Error(Errno::UnknownErrno)) => Ok(ret),
+ Ok(..) | Err(Errno::UnknownErrno) => Ok(ret),
err @ Err(..) => err,
}
}
diff --git a/src/sys/signalfd.rs b/src/sys/signalfd.rs
index 32245bc6..49811a1a 100644
--- a/src/sys/signalfd.rs
+++ b/src/sys/signalfd.rs
@@ -108,7 +108,7 @@ impl SignalFd {
match res {
Ok(SIGNALFD_SIGINFO_SIZE) => Ok(Some(unsafe { mem::transmute(buffer.assume_init()) })),
Ok(_) => unreachable!("partial read on signalfd"),
- Err(Error(Errno::EAGAIN)) => Ok(None),
+ Err(Errno::EAGAIN) => Ok(None),
Err(error) => Err(error)
}
}
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs
index ff64b73f..c222bdd7 100644
--- a/src/sys/socket/mod.rs
+++ b/src/sys/socket/mod.rs
@@ -1572,7 +1572,7 @@ pub fn recvfrom(sockfd: RawFd, buf: &mut [u8])
&mut len as *mut socklen_t))? as usize;
match sockaddr_storage_to_addr(&addr, len as usize) {
- Err(Error(Errno::ENOTCONN)) => Ok((ret, None)),
+ Err(Errno::ENOTCONN) => Ok((ret, None)),
Ok(addr) => Ok((ret, Some(addr))),
Err(e) => Err(e)
}
diff --git a/src/sys/timerfd.rs b/src/sys/timerfd.rs
index 3ae4ca32..44915be1 100644
--- a/src/sys/timerfd.rs
+++ b/src/sys/timerfd.rs
@@ -30,7 +30,7 @@
//! ```
use crate::sys::time::TimeSpec;
use crate::unistd::read;
-use crate::{errno::Errno, Error, Result};
+use crate::{errno::Errno, Result};
use bitflags::bitflags;
use libc::c_int;
use std::os::unix::io::{AsRawFd, FromRawFd, RawFd};
@@ -259,7 +259,7 @@ impl TimerFd {
loop {
if let Err(e) = read(self.fd, &mut [0u8; 8]) {
match e {
- Error(Errno::EINTR) => continue,
+ Errno::EINTR => continue,
_ => return Err(e),
}
} else {
@@ -277,7 +277,7 @@ impl Drop for TimerFd {
let result = Errno::result(unsafe {
libc::close(self.fd)
});
- if let Err(Error(Errno::EBADF)) = result {
+ if let Err(Errno::EBADF) = result {
panic!("close of TimerFd encountered EBADF");
}
}