From 302887dc3de7ac642774eee89d54ae066bccc3e7 Mon Sep 17 00:00:00 2001 From: Andrey Dyldin Date: Sat, 23 Jan 2021 22:41:30 +0200 Subject: [PATCH] cleaning --- src/fe/mod.rs | 8 +++++--- src/fe/sys.rs | 4 +--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/fe/mod.rs b/src/fe/mod.rs index a5f09e9..4bee543 100644 --- a/src/fe/mod.rs +++ b/src/fe/mod.rs @@ -14,7 +14,10 @@ use { ops::Range, os::linux::fs::MetadataExt, os::unix::{ - fs::OpenOptionsExt, + fs::{ + OpenOptionsExt, + FileTypeExt, + }, io::{ AsRawFd, RawFd, @@ -233,10 +236,9 @@ impl FeDevice { // dev-file metadata let metadata = self.file.metadata().context("fe get device metadata")?; - let mode = metadata.st_mode(); ensure!( - (mode & ::libc::S_IFMT) == ::libc::S_IFCHR, + metadata.file_type().is_char_device(), FeError::InvalidDeviceFormat ); diff --git a/src/fe/sys.rs b/src/fe/sys.rs index a05e0ae..3256fd9 100644 --- a/src/fe/sys.rs +++ b/src/fe/sys.rs @@ -4,8 +4,6 @@ use { mem, }, - libc, - crate::ioctl::{ IoctlInt, io_none, @@ -510,7 +508,7 @@ pub struct DtvPropertyBuffer { pub data: [u8; 32], pub len: u32, __reserved_1: [u32; 3], - __reserved_2: *mut libc::c_void, + __reserved_2: *mut std::ffi::c_void, }