mirror of
https://github.com/kata-containers/cgroups-rs.git
synced 2026-08-05 02:13:23 +00:00
Fix warnings
Got:
cargo build --target x86_64-unknown-linux-musl
Compiling cgroups v0.1.1-alpha.0 (/home/tim/project/cgroups-rs)
warning: unused import: `nix::sys::statfs`
--> src/hierarchies.rs:220:5
|
220 | use nix::sys::statfs;
| ^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: 1 warning emitted
Signed-off-by: Tim Zhang <tim@hyper.sh>
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
//!
|
||||
//! Currently, we only support the cgroupv1 hierarchy, but in the future we will add support for
|
||||
//! the Unified Hierarchy.
|
||||
use nix::sys::statfs;
|
||||
|
||||
use std::fs::{self, File};
|
||||
use std::io::BufRead;
|
||||
@@ -220,6 +219,8 @@ pub const UNIFIED_MOUNTPOINT: &'static str = "/sys/fs/cgroup";
|
||||
|
||||
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
|
||||
pub fn is_cgroup2_unified_mode() -> bool {
|
||||
use nix::sys::statfs;
|
||||
|
||||
let path = Path::new(UNIFIED_MOUNTPOINT);
|
||||
let fs_stat = statfs::statfs(path);
|
||||
if fs_stat.is_err() {
|
||||
|
||||
Reference in New Issue
Block a user