summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2021-09-20 09:42:35 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2021-09-20 16:15:29 +0200
commit331ce0f7ee2736d5f012ea6a6d2aba77213e3956 (patch)
tree8fd7b4fc5dc22e69cd8bb577ad1a50a145e081fd /utils
parent046fa274086e97ad73532c039e61fc7833ce859a (diff)
downloadpodman-331ce0f7ee2736d5f012ea6a6d2aba77213e3956.tar.gz
podman-331ce0f7ee2736d5f012ea6a6d2aba77213e3956.tar.bz2
podman-331ce0f7ee2736d5f012ea6a6d2aba77213e3956.zip
utils: return error message from StartTransientUnit
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> (cherry picked from commit eea5d251267d070d7920008056e3e4d603cae204)
Diffstat (limited to 'utils')
-rw-r--r--utils/utils_supported.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/utils_supported.go b/utils/utils_supported.go
index ebc870d26..1404e3194 100644
--- a/utils/utils_supported.go
+++ b/utils/utils_supported.go
@@ -47,10 +47,10 @@ func RunUnderSystemdScope(pid int, slice string, unitName string) error {
// On errors check if the cgroup already exists, if it does move the process there
if props, err := conn.GetUnitTypeProperties(unitName, "Scope"); err == nil {
if cgroup, ok := props["ControlGroup"].(string); ok && cgroup != "" {
- if err := moveUnderCgroup(cgroup, "", []uint32{uint32(pid)}); err != nil {
- return err
+ if err := moveUnderCgroup(cgroup, "", []uint32{uint32(pid)}); err == nil {
+ return nil
}
- return nil
+ // On errors return the original error message we got from StartTransientUnit.
}
}
return err