More clippy
This commit is contained in:
parent
08a41492b8
commit
3f7afc5b78
1 changed files with 8 additions and 12 deletions
|
|
@ -18,19 +18,15 @@ pub fn get_entries() -> Result<Vec<PortDesc>> {
|
||||||
// error we encounter as it probably means we have no access to that
|
// error we encounter as it probably means we have no access to that
|
||||||
// process or something.
|
// process or something.
|
||||||
let mut map: HashMap<u64, String> = HashMap::new();
|
let mut map: HashMap<u64, String> = HashMap::new();
|
||||||
for p in all_procs {
|
for process in all_procs.flatten() {
|
||||||
if let Ok(process) = p {
|
if !process.is_alive() {
|
||||||
if !process.is_alive() {
|
continue; // Ignore zombies.
|
||||||
continue; // Ignore zombies.
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if let (Ok(fds), Ok(cmd)) = (process.fd(), process.cmdline()) {
|
if let (Ok(fds), Ok(cmd)) = (process.fd(), process.cmdline()) {
|
||||||
for fd in fds {
|
for fd in fds.flatten() {
|
||||||
if let Ok(fd) = fd {
|
if let FDTarget::Socket(inode) = fd.target {
|
||||||
if let FDTarget::Socket(inode) = fd.target {
|
map.insert(inode, cmd.join(" "));
|
||||||
map.insert(inode, cmd.join(" "));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue