diff options
author | Alan Somers <asomers@gmail.com> | 2021-06-12 13:12:10 -0600 |
---|---|---|
committer | Alan Somers <asomers@gmail.com> | 2021-07-07 20:49:29 -0600 |
commit | 2d796eba380e8f4e5d935b6b356c9d401917b92d (patch) | |
tree | 7b344bb84c5e8a6957f46490e151551b09ce7f1b /src/sys/timerfd.rs | |
parent | 6511d02414ec9dd4bcaa237336c5f74869e6c41a (diff) | |
download | nix-2d796eba380e8f4e5d935b6b356c9d401917b92d.zip |
Collapse Error into Errno
Now that Nix's weird error types are eliminated, there's no reason not
to simply use Errno as the Error type.
Diffstat (limited to 'src/sys/timerfd.rs')
-rw-r--r-- | src/sys/timerfd.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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"); } } |