mirror of
https://github.com/joleuger/vuinputd.git
synced 2026-07-17 16:36:03 +00:00
Remove unused imports
This commit is contained in:
parent
c792529395
commit
2fe9a70006
10 changed files with 26 additions and 88 deletions
|
|
@ -2,23 +2,14 @@
|
|||
//
|
||||
// Author: Johannes Leupolz <dev@leupolz.eu>
|
||||
|
||||
use libc::{O_CLOEXEC, input_id};
|
||||
use libc::{iovec, off_t, size_t, EBADRQC, EIO, ENOENT};
|
||||
use libc::{iovec, size_t, EBADRQC};
|
||||
use libc::{uinput_abs_setup, uinput_ff_erase, uinput_ff_upload, uinput_setup};
|
||||
use ::cuse_lowlevel::*;
|
||||
use log::{debug, error, info, trace};
|
||||
use std::collections::HashMap;
|
||||
use std::ffi::{CStr, CString};
|
||||
use std::{fs, ptr};
|
||||
use std::fs::{File, OpenOptions};
|
||||
use log::{debug};
|
||||
use std::ffi::{CStr};
|
||||
use std::io::Write;
|
||||
use std::io::{self, ErrorKind};
|
||||
use std::os::fd::AsRawFd;
|
||||
use std::os::raw::{c_char, c_int, c_uint, c_void};
|
||||
use std::os::unix::fs::{FileTypeExt, MetadataExt, OpenOptionsExt};
|
||||
use std::path::Path;
|
||||
use std::sync::atomic::{AtomicU64, Ordering};
|
||||
use std::sync::{Arc, Mutex, OnceLock, RwLock};
|
||||
use uinput_ioctls::*;
|
||||
|
||||
use crate::cuse_device::{SYS_INPUT_DIR, VuFileHandle, VuInputDevice, fetch_device_node, get_vuinput_state};
|
||||
|
|
|
|||
|
|
@ -3,24 +3,14 @@
|
|||
// Author: Johannes Leupolz <dev@leupolz.eu>
|
||||
|
||||
use std::sync::OnceLock;
|
||||
use libc::{O_CLOEXEC, input_id};
|
||||
use libc::{iovec, off_t, size_t, EBADRQC, EIO, ENOENT};
|
||||
use libc::{uinput_abs_setup, uinput_ff_erase, uinput_ff_upload, uinput_setup};
|
||||
use libc::{O_CLOEXEC};
|
||||
use libc::{ENOENT};
|
||||
use ::cuse_lowlevel::*;
|
||||
use log::{debug, error, info, trace};
|
||||
use std::collections::HashMap;
|
||||
use std::ffi::{CStr, CString};
|
||||
use std::{fs, ptr};
|
||||
use std::fs::{File, OpenOptions};
|
||||
use std::io::Write;
|
||||
use std::io::{self, ErrorKind};
|
||||
use std::os::fd::AsRawFd;
|
||||
use std::os::raw::{c_char, c_int, c_uint, c_void};
|
||||
use std::os::unix::fs::{FileTypeExt, MetadataExt, OpenOptionsExt};
|
||||
use log::{debug, error};
|
||||
use std::fs::{OpenOptions};
|
||||
use std::os::unix::fs::{OpenOptionsExt};
|
||||
use std::path::Path;
|
||||
use std::sync::atomic::{AtomicU64, Ordering};
|
||||
use std::sync::{Arc, Mutex, RwLock};
|
||||
use uinput_ioctls::*;
|
||||
|
||||
use crate::process_tools::{Pid, get_requesting_process};
|
||||
use crate::cuse_device::*;
|
||||
|
|
|
|||
|
|
@ -2,24 +2,9 @@
|
|||
//
|
||||
// Author: Johannes Leupolz <dev@leupolz.eu>
|
||||
|
||||
use libc::{O_CLOEXEC, input_id};
|
||||
use libc::{iovec, off_t, size_t, EBADRQC, EIO, ENOENT};
|
||||
use libc::{uinput_abs_setup, uinput_ff_erase, uinput_ff_upload, uinput_setup};
|
||||
use ::cuse_lowlevel::*;
|
||||
use log::{debug, error, info, trace};
|
||||
use std::collections::HashMap;
|
||||
use std::ffi::{CStr, CString};
|
||||
use std::{fs, ptr};
|
||||
use std::fs::{File, OpenOptions};
|
||||
use std::io::Write;
|
||||
use std::io::{self, ErrorKind};
|
||||
use std::os::fd::AsRawFd;
|
||||
use std::os::raw::{c_char, c_int, c_uint, c_void};
|
||||
use std::os::unix::fs::{FileTypeExt, MetadataExt, OpenOptionsExt};
|
||||
use std::path::Path;
|
||||
use std::sync::atomic::{AtomicU64, Ordering};
|
||||
use std::sync::{Arc, Mutex, OnceLock, RwLock};
|
||||
use uinput_ioctls::*;
|
||||
use log::{debug};
|
||||
use std::sync::{Arc};
|
||||
use crate::{cuse_device::*, jobs};
|
||||
use crate::job_engine::JOB_DISPATCHER;
|
||||
use crate::jobs::remove_from_container_job::RemoveFromContainerJob;
|
||||
|
|
|
|||
|
|
@ -2,25 +2,15 @@
|
|||
//
|
||||
// Author: Johannes Leupolz <dev@leupolz.eu>
|
||||
|
||||
use libc::{O_CLOEXEC, input_id};
|
||||
use libc::{iovec, off_t, size_t, EBADRQC, EIO, ENOENT};
|
||||
use libc::{uinput_abs_setup, uinput_ff_erase, uinput_ff_upload, uinput_setup};
|
||||
use libc::{off_t, size_t, EIO};
|
||||
use libc::{uinput_abs_setup, uinput_setup};
|
||||
use ::cuse_lowlevel::*;
|
||||
use log::{debug, error, info, trace};
|
||||
use std::collections::HashMap;
|
||||
use std::ffi::{CStr, CString};
|
||||
use std::{fs, ptr};
|
||||
use std::fs::{File, OpenOptions};
|
||||
use log::{debug, trace};
|
||||
use std::io::Write;
|
||||
use std::io::{self, ErrorKind};
|
||||
use std::os::fd::AsRawFd;
|
||||
use std::os::raw::{c_char, c_int, c_uint, c_void};
|
||||
use std::os::unix::fs::{FileTypeExt, MetadataExt, OpenOptionsExt};
|
||||
use std::path::Path;
|
||||
use std::sync::atomic::{AtomicU64, Ordering};
|
||||
use std::sync::{Arc, Mutex, OnceLock, RwLock};
|
||||
use std::os::raw::{c_char};
|
||||
use uinput_ioctls::*;
|
||||
use libc::{__s32, __u16, c_ulong, input_event};
|
||||
use libc::{__s32, __u16, input_event};
|
||||
use crate::cuse_device::*;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ impl InjectInContainerJob {
|
|||
// wait a maximum of 5 seconds == 50 attempts
|
||||
Timer::after(Duration::from_millis(100)).await;
|
||||
}
|
||||
if (netlink_data.is_none() || runtime_data.is_none()) {
|
||||
if netlink_data.is_none() || runtime_data.is_none() {
|
||||
if netlink_data.is_none() {
|
||||
debug!("Give up reading netlink data");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,9 @@
|
|||
// Author: Johannes Leupolz <dev@leupolz.eu>
|
||||
|
||||
use nix::sys::stat::{makedev, mknod, stat, Mode, SFlag};
|
||||
use nix::unistd::{chown, Gid, Uid};
|
||||
use std::error::Error;
|
||||
use std::fs;
|
||||
use std::os::unix::fs::{MetadataExt, PermissionsExt};
|
||||
use std::os::unix::fs::{PermissionsExt};
|
||||
use std::path::Path;
|
||||
|
||||
pub fn ensure_input_device(dev_path: String, major: u64, minor: u64) -> Result<(), Box<dyn Error>> {
|
||||
|
|
|
|||
|
|
@ -2,12 +2,11 @@
|
|||
//
|
||||
// Author: Johannes Leupolz <dev@leupolz.eu>
|
||||
|
||||
use std::{collections::HashMap, future::Future, pin::Pin, sync::{Arc, Condvar, Mutex}, time::Duration};
|
||||
use std::{future::Future, pin::Pin, sync::{Arc, Condvar, Mutex}};
|
||||
|
||||
use async_io::Timer;
|
||||
use log::debug;
|
||||
|
||||
use crate::{job_engine::job::{Job, JobTarget}, jobs::{mknod_input_device::remove_input_device, monitor_udev_job::EVENT_STORE, netlink_message::send_udev_monitor_message_with_properties, runtime_data::{delete_udev_data, ensure_udev_structure, read_udev_data, write_udev_data}}, process_tools::{Pid, RequestingProcess, await_process, run_in_net_and_mnt_namespace}};
|
||||
use crate::{job_engine::job::{Job, JobTarget}, jobs::{mknod_input_device::remove_input_device, monitor_udev_job::EVENT_STORE, netlink_message::send_udev_monitor_message_with_properties, runtime_data::{delete_udev_data}}, process_tools::{Pid, RequestingProcess, await_process, run_in_net_and_mnt_namespace}};
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,6 @@ pub fn read_udev_data(major: u64, minor: u64) -> io::Result<String> {
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_replacement_and_filter() {
|
||||
|
|
|
|||
|
|
@ -17,33 +17,19 @@
|
|||
// naming: dev_path vs dev_node. I guess I mean the same.
|
||||
// Send warning, if udev monitor does not exist
|
||||
|
||||
|
||||
use libc::{O_CLOEXEC, input_id};
|
||||
use libc::{iovec, off_t, size_t, EBADRQC, EIO, ENOENT};
|
||||
use libc::{uinput_abs_setup, uinput_ff_erase, uinput_ff_upload, uinput_setup};
|
||||
use ::cuse_lowlevel::*;
|
||||
use log::{debug, error, info, trace};
|
||||
use log::info;
|
||||
use std::collections::HashMap;
|
||||
use std::ffi::{CStr, CString};
|
||||
use std::{fs, ptr};
|
||||
use std::fs::{File, OpenOptions};
|
||||
use std::io::Write;
|
||||
use std::io::{self, ErrorKind};
|
||||
use std::os::fd::AsRawFd;
|
||||
use std::os::raw::{c_char, c_int, c_uint, c_void};
|
||||
use std::os::unix::fs::{FileTypeExt, MetadataExt, OpenOptionsExt};
|
||||
use std::path::Path;
|
||||
use std::sync::atomic::{AtomicU64, Ordering};
|
||||
use std::sync::{Arc, Mutex, OnceLock, RwLock};
|
||||
use uinput_ioctls::*;
|
||||
use std::ffi::CString;
|
||||
use std::os::raw::{c_char};
|
||||
use std::sync::atomic::{AtomicU64};
|
||||
use std::sync::{Mutex, RwLock};
|
||||
|
||||
pub mod cuse_device;
|
||||
|
||||
use crate::cuse_device::vuinput_open::VUINPUT_COUNTER;
|
||||
use crate::cuse_device::{DEDUP_LAST_ERROR, VUINPUT_STATE, vuinput_make_cuse_ops};
|
||||
use crate::jobs::inject_in_container_job::InjectInContainerJob;
|
||||
use crate::jobs::monitor_udev_job::MonitorBackgroundLoop;
|
||||
use crate::jobs::remove_from_container_job::RemoveFromContainerJob;
|
||||
|
||||
pub mod process_tools;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,11 +9,10 @@ use nix::{
|
|||
unistd::{fork, ForkResult},
|
||||
};
|
||||
use std::{
|
||||
fs::{self, File}, io::Read, os::fd::{AsFd, FromRawFd, OwnedFd, RawFd}, path::{self, Path}, process, sync::OnceLock, thread, time::Duration
|
||||
fs::{self, File}, io::Read, os::fd::{AsFd, FromRawFd, OwnedFd, RawFd}, path::{Path}, process, sync::OnceLock
|
||||
};
|
||||
|
||||
use std::io::{self, BufRead};
|
||||
use std::path::PathBuf;
|
||||
use std::io;
|
||||
|
||||
pub static SELF_NAMESPACES: OnceLock<Namespaces>= OnceLock::new();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue