mirror of
https://github.com/mii443/izoli.git
synced 2025-08-22 16:05:40 +00:00
add Drop for CGroup
This commit is contained in:
@ -17,6 +17,13 @@ pub struct CGroup {
|
|||||||
pub path: PathBuf,
|
pub path: PathBuf,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Drop for CGroup {
|
||||||
|
fn drop(&mut self) {
|
||||||
|
let root = self.get_root_path();
|
||||||
|
let _ = fs::remove_dir(root);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl CGroup {
|
impl CGroup {
|
||||||
pub fn new(path: &str) -> Result<Self, std::io::Error> {
|
pub fn new(path: &str) -> Result<Self, std::io::Error> {
|
||||||
info!("creating new cgroup");
|
info!("creating new cgroup");
|
||||||
|
Reference in New Issue
Block a user