remove src/tools/procfs.rs, use proxmox::sys::linux::procfs instead

This commit is contained in:
Dietmar Maurer
2019-08-03 16:26:44 +02:00
parent 779e4c90b1
commit fd329bdcd7
4 changed files with 3 additions and 426 deletions

View File

@ -62,7 +62,7 @@ impl UPID {
Ok(UPID {
pid,
pstart: tools::procfs::read_proc_starttime(pid)?,
pstart: proxmox::sys::linux::procfs::read_proc_starttime(pid)?,
starttime: Local::now().timestamp(),
task_id,
worker_type: worker_type.to_owned(),

View File

@ -36,7 +36,7 @@ lazy_static! {
static ref WORKER_TASK_LIST: Mutex<HashMap<usize, Arc<WorkerTask>>> = Mutex::new(HashMap::new());
static ref MY_PID: i32 = unsafe { libc::getpid() };
static ref MY_PID_PSTART: u64 = crate::tools::procfs::read_proc_pid_stat(*MY_PID).unwrap().starttime;
static ref MY_PID_PSTART: u64 = proxmox::sys::linux::procfs::read_proc_pid_stat(*MY_PID).unwrap().starttime;
}
/// Test if the task is still running
@ -49,7 +49,7 @@ pub fn worker_is_active(upid: &UPID) -> bool {
false
}
} else {
match crate::tools::procfs::check_process_running_pstart(upid.pid, upid.pstart) {
match proxmox::sys::linux::procfs::check_process_running_pstart(upid.pid, upid.pstart) {
Some(_) => true,
_ => false,
}