From b9ca0a51f1817c181e809ca12a7ac7448cadddfd Mon Sep 17 00:00:00 2001 From: Jakob Naucke Date: Mon, 22 Feb 2021 14:21:35 +0100 Subject: [PATCH] Update nix to 0.20.0 to pull in https://github.com/nix-rust/nix/pull/1372 and get statfs MAGIC constants on s390x. Additionally, fork() calls in tests now have to be marked unsafe. Fixes: #37 Signed-off-by: Jakob Naucke --- Cargo.toml | 2 +- tests/pids.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 50e6cb3..50ee8cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ readme = "README.md" [dependencies] log = "0.4" regex = "1.1" -nix = "0.18.0" +nix = "0.20.0" libc = "0.2" [dev-dependencies] diff --git a/tests/pids.rs b/tests/pids.rs index cdae865..94d9ce1 100644 --- a/tests/pids.rs +++ b/tests/pids.rs @@ -62,7 +62,7 @@ fn test_pid_events_is_not_zero() { let before = pids.get_pid_events(); let before = before.unwrap(); - match fork() { + match unsafe { fork() } { Ok(ForkResult::Parent { child, .. }) => { // move the process into the control group let _ = pids.add_task(&(pid_t::from(child) as u64).into()); @@ -89,7 +89,7 @@ fn test_pid_events_is_not_zero() { Ok(ForkResult::Child) => loop { let pids_max = pids.get_pid_max(); if pids_max.is_ok() && pids_max.unwrap() == MaxValue::Value(1) { - if let Err(_) = fork() { + if let Err(_) = unsafe { fork() } { unsafe { libc::exit(0) }; } else { unsafe { libc::exit(1) };