Skip to content

Commit 4f85ac6

Browse files
committed
fix(epoll): remove check_err function
1 parent e596636 commit 4f85ac6

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/timer/epoll.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// https://www.apache.org/licenses/LICENSE-2.0>. This file may not be copied, modified, or distributed
55
// except according to those terms.
66

7-
use crate::utils::{epoll_create1, epoll_ctl, epoll_wait, read, timerfd_create, timerfd_settime};
87
use crate::Result;
8+
use crate::utils::check_err;
99

1010
use std::sync::{mpsc::Sender, Arc, Mutex};
1111
use std::{thread, thread::JoinHandle};
@@ -166,14 +166,6 @@ impl Timer {
166166
/// instead of expanding this wrappers (if more functions and types are used
167167
/// from libc)
168168
169-
/// Error Wrapper for libc return. Only check for errors.
170-
fn check_err<T: Ord + Default>(num: T) -> Result<T> {
171-
if num < T::default() {
172-
return Err(PyroscopeError::from(std::io::Error::last_os_error()));
173-
}
174-
Ok(num)
175-
}
176-
177169
/// libc::timerfd wrapper
178170
pub fn timerfd_create(clockid: libc::clockid_t, clock_flags: libc::c_int) -> Result<i32> {
179171
check_err(unsafe { libc::timerfd_create(clockid, clock_flags) }).map(|timer_fd| timer_fd as i32)

0 commit comments

Comments
 (0)