Skip to content

Commit

Permalink
utils: skip empty lines
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Feb 11, 2021
1 parent 055e2dd commit f4fd25a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils/utils_supported.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit f4fd25a

Please sign in to comment.