From 993d25ab1f7ee7503409cc10a9c09792ccb6de2b Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Mon, 4 Mar 2024 12:47:16 +0100 Subject: [PATCH] fixing linux build --- src/platform/linux.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platform/linux.rs b/src/platform/linux.rs index f676e36..048b059 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -37,8 +37,8 @@ fn get_all_processes() -> Vec { 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 = @@ -153,8 +153,8 @@ fn get_socket_inodes, Q: AsRef>( 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();