aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2021-02-10 15:03:45 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2021-02-12 09:53:24 +0100
commitf13f53d6e1e52cff83168814a96c376178360ea3 (patch)
tree6bd18adb8c6fa145737fde5b63f5dc04cf6cfbca /utils
parentddd8a1799dfc1621da39f672a47e9984ebec0e2f (diff)
downloadpodman-f13f53d6e1e52cff83168814a96c376178360ea3.tar.gz
podman-f13f53d6e1e52cff83168814a96c376178360ea3.tar.bz2
podman-f13f53d6e1e52cff83168814a96c376178360ea3.zip
utils: skip empty lines
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> (cherry picked from commit f4fd25a005ae00afe7574bd4eb9a428a6b5c81dd)
Diffstat (limited to 'utils')
-rw-r--r--utils/utils_supported.go3
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)
}