From 52ddc2522d1024c691cd858db9dbaaf19b71e142 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 4 Apr 2019 08:05:43 +0200 Subject: [PATCH] src/tools/procfs.rs: use libc::pid_t --- src/tools/procfs.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/procfs.rs b/src/tools/procfs.rs index 9187096d..9c81531a 100644 --- a/src/tools/procfs.rs +++ b/src/tools/procfs.rs @@ -13,7 +13,7 @@ pub struct ProcFsPidStat { pub rss: i64, } -pub fn read_proc_pid_stat(pid: nix::unistd::Pid) -> Result { +pub fn read_proc_pid_stat(pid: libc::pid_t) -> Result { let statstr = tools::file_read_firstline(format!("/proc/{}/stat", pid))?; @@ -22,7 +22,7 @@ pub fn read_proc_pid_stat(pid: nix::unistd::Pid) -> Result } if let Some(cap) = REGEX.captures(&statstr) { - if pid != nix::unistd::Pid::from_raw(cap["pid"].parse::().unwrap()) { + if pid != cap["pid"].parse::().unwrap() { bail!("unable to read pid stat for process '{}' - got wrong pid", pid); } @@ -40,7 +40,7 @@ pub fn read_proc_pid_stat(pid: nix::unistd::Pid) -> Result bail!("unable to read pid stat for process '{}'", pid); } -pub fn read_proc_starttime(pid: nix::unistd::Pid) -> Result { +pub fn read_proc_starttime(pid: libc::pid_t) -> Result { let info = read_proc_pid_stat(pid)?;