diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-09-13 14:58:32 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-09-13 14:59:07 +0200 |
commit | 466694b881e2494c431172f326738016a63ed263 (patch) | |
tree | 6d4df29f18ebd743d500065b26068692269030c7 /cmd/podman | |
parent | b095d8a794edaab3b2d622b6882bfd57fad8375e (diff) | |
download | podman-466694b881e2494c431172f326738016a63ed263.tar.gz podman-466694b881e2494c431172f326738016a63ed263.tar.bz2 podman-466694b881e2494c431172f326738016a63ed263.zip |
rootless: report the correct error
do not shadow the err variable so that the correct error message can
be reported when utils.RunUnderSystemdScope fails.
Closes: https://github.com/containers/libpod/issues/4012
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/main_local.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/podman/main_local.go b/cmd/podman/main_local.go index cad256615..08d7ccaf4 100644 --- a/cmd/podman/main_local.go +++ b/cmd/podman/main_local.go @@ -178,9 +178,9 @@ func setupRootless(cmd *cobra.Command, args []string) error { if !ownsCgroup { unitName := fmt.Sprintf("podman-%d.scope", os.Getpid()) if err := utils.RunUnderSystemdScope(os.Getpid(), "user.slice", unitName); err != nil { - conf, err := runtime.GetConfig() - if err != nil { - return err + conf, err2 := runtime.GetConfig() + if err2 != nil { + return err2 } if conf.CgroupManager == libpod.SystemdCgroupsManager { logrus.Warnf("Failed to add podman to systemd sandbox cgroup: %v", err) |