From 7766c1e07bd49fdc290f0557268950d35b867823 Mon Sep 17 00:00:00 2001 From: Qiang Huang Date: Tue, 24 Mar 2015 09:19:40 +0800 Subject: [PATCH] remove redundant code Now we return not found err in path(), so no need to check again. Signed-off-by: Qiang Huang --- cgroups/fs/apply_raw.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cgroups/fs/apply_raw.go b/cgroups/fs/apply_raw.go index 5cb8467c..c771245d 100644 --- a/cgroups/fs/apply_raw.go +++ b/cgroups/fs/apply_raw.go @@ -173,9 +173,6 @@ func (m *Manager) Freeze(state configs.FreezerState) error { if err != nil { return err } - if !cgroups.PathExists(dir) { - return cgroups.NewNotFoundError("freezer") - } prevState := m.Cgroups.Freezer m.Cgroups.Freezer = state @@ -200,9 +197,6 @@ func (m *Manager) GetPids() ([]int, error) { if err != nil { return nil, err } - if !cgroups.PathExists(dir) { - return nil, cgroups.NewNotFoundError("devices") - } return cgroups.ReadProcsFile(dir) }