diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2021-02-10 15:03:45 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2021-02-11 09:38:34 +0100 |
commit | f4fd25a005ae00afe7574bd4eb9a428a6b5c81dd (patch) | |
tree | aa3b3ecc636d1b63ba6eb6db97f7395ce913c6f5 | |
parent | 055e2dda3a1888d319d542abe8735e791e736451 (diff) | |
download | podman-f4fd25a005ae00afe7574bd4eb9a428a6b5c81dd.tar.gz podman-f4fd25a005ae00afe7574bd4eb9a428a6b5c81dd.tar.bz2 podman-f4fd25a005ae00afe7574bd4eb9a428a6b5c81dd.zip |
utils: skip empty lines
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
-rw-r--r-- | utils/utils_supported.go | 3 |
1 files changed, 3 insertions, 0 deletions
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) } |