From 755bc774825738671541b1733f6ca1b008d72b47 Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Mon, 27 Apr 2015 23:49:38 +0300 Subject: [PATCH] cgroups/systemd: remove useless code I think the remove code and devices.Set do the same things. Signed-off-by: Andrey Vagin --- cgroups/systemd/apply_systemd.go | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/cgroups/systemd/apply_systemd.go b/cgroups/systemd/apply_systemd.go index e5e68ad8..c2ea56d6 100644 --- a/cgroups/systemd/apply_systemd.go +++ b/cgroups/systemd/apply_systemd.go @@ -398,33 +398,7 @@ func joinDevices(c *configs.Cgroup, pid int) error { } devices := subsystems["devices"] - if err := devices.Set(path, c); err != nil { - return err - } - - if !c.AllowAllDevices { - if err := writeFile(path, "devices.deny", "a"); err != nil { - return err - } - for _, dev := range c.AllowedDevices { - if err := writeFile(path, "devices.allow", dev.CgroupString()); err != nil { - return err - } - } - return nil - } - - if err := writeFile(path, "devices.allow", "a"); err != nil { - return err - } - - for _, dev := range c.DeniedDevices { - if err := writeFile(path, "devices.deny", dev.CgroupString()); err != nil { - return err - } - } - - return nil + return devices.Set(path, c) } // Symmetrical public function to update device based cgroups. Also available