utils: skip empty lines
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
055e2dda3a
commit
f4fd25a005
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue