Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
GyulyVGC committed Mar 4, 2024
1 parent 496c99f commit fa7820b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ edition = "2021"
[target.'cfg(target_os = "linux")'.dependencies]
procfs = "0.16.0"
once_cell = "1.19.0"
rustix = {version = "0.38.19", features = ["procfs", "fs"]}
rustix = {version = "0.38.31", features = ["procfs", "fs"]}
7 changes: 3 additions & 4 deletions src/platform/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,17 @@ fn build_inode_process_map(processes: Vec<Process>) -> HashMap<u64, PidName> {
.unwrap();
let mut dir = rustix::fs::Dir::read_from(&dir_fd).unwrap();
let mut socket_inodes = Vec::new();
println!("\t stat: {:?}", stat);
println!("\t dir_fd: {:?}", dir_fd);
println!("\t dir: {:?}", dir);
if let Some(Ok(entry)) = dir.next() {
let name = entry.file_name().to_string_lossy();
println!("\t file name: {:?}", name);
if let Ok(fd) = RawFd::from_str(&name) {
println!("\t Found valid!! With name {:?}", name);
if let Some(socket_inode) =
get_socket_inodes(process.root, dir_fd.as_fd(), name.as_ref(), fd)
{
socket_inodes.push(socket_inode);
}
} else {
println!("\t Not a valid name: {:?}", name);
}
}
if let Some(pid_name) = PidName::from_file(File::from(stat)) {
Expand Down

0 comments on commit fa7820b

Please sign in to comment.