From f4fd25a005ae00afe7574bd4eb9a428a6b5c81dd Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 10 Feb 2021 15:03:45 +0100 Subject: utils: skip empty lines Signed-off-by: Giuseppe Scrivano --- utils/utils_supported.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/utils_supported.go b/utils/utils_supported.go index 6f517dc72..dfa0b486a 100644 --- a/utils/utils_supported.go +++ b/utils/utils_supported.go @@ -183,6 +183,9 @@ func moveUnderCgroup(cgroup, subtree string, processes []uint32) error { return err } for _, pid := range bytes.Split(processesData, []byte("\n")) { + if len(pid) == 0 { + continue + } if _, err := f.Write(pid); err != nil { logrus.Warnf("Cannot move process %s to cgroup %q", string(pid), newCgroup) } -- cgit v1.2.3-54-g00ecf