From 2d796eba380e8f4e5d935b6b356c9d401917b92d Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sat, 12 Jun 2021 13:12:10 -0600 Subject: 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. --- src/sys/timerfd.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/sys/timerfd.rs') 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"); } } -- cgit v1.2.3