Skip to content

Commit

Permalink
fixing linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
GyulyVGC committed Mar 4, 2024
1 parent da50ddd commit 993d25a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/platform/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ fn get_all_processes() -> Vec<Process> {
let proc_root = PathBuf::from(ROOT).join(pid.to_string());

// for 2.6.39 <= kernel < 3.6 fstat doesn't support O_PATH see https://github.com/eminence/procfs/issues/265
let flags = match KERNEL {
Some(v) if v < String::from("3.6.0") => OFlags::DIRECTORY | OFlags::CLOEXEC,
let flags = match &*KERNEL {
Some(v) if v < &String::from("3.6.0") => OFlags::DIRECTORY | OFlags::CLOEXEC,
Some(_) | None => OFlags::PATH | OFlags::DIRECTORY | OFlags::CLOEXEC,
};
let file =
Expand Down Expand Up @@ -153,8 +153,8 @@ fn get_socket_inodes<P: AsRef<Path>, Q: AsRef<Path>>(
let p = path.as_ref();
let root = base.as_ref().join(p);
// for 2.6.39 <= kernel < 3.6 fstat doesn't support O_PATH see https://github.com/eminence/procfs/issues/265
let flags = match KERNEL {
Some(v) if v < String::from("3.6.0") => OFlags::NOFOLLOW | OFlags::CLOEXEC,
let flags = match &*KERNEL {
Some(v) if v < &String::from("3.6.0") => OFlags::NOFOLLOW | OFlags::CLOEXEC,
Some(_) | None => OFlags::NOFOLLOW | OFlags::PATH | OFlags::CLOEXEC,
};
let file = rustix::fs::openat(dirfd, p, flags, Mode::empty()).unwrap();
Expand Down

0 comments on commit 993d25a

Please sign in to comment.