summaryrefslogtreecommitdiff
path: root/utils/utils_supported.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2021-02-10 15:03:45 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2021-02-11 09:38:34 +0100
commitf4fd25a005ae00afe7574bd4eb9a428a6b5c81dd (patch)
treeaa3b3ecc636d1b63ba6eb6db97f7395ce913c6f5 /utils/utils_supported.go
parent055e2dda3a1888d319d542abe8735e791e736451 (diff)
downloadpodman-f4fd25a005ae00afe7574bd4eb9a428a6b5c81dd.tar.gz
podman-f4fd25a005ae00afe7574bd4eb9a428a6b5c81dd.tar.bz2
podman-f4fd25a005ae00afe7574bd4eb9a428a6b5c81dd.zip
utils: skip empty lines
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'utils/utils_supported.go')
-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)
}