Skip to content

Commit

Permalink
Merge pull request #409 from giuseppe/cgroupfs-fix-ret-check
Browse files Browse the repository at this point in the history
crun: fix return code check for cgroupfs
  • Loading branch information
rhatdan authored Jun 18, 2020
2 parents 63e91ff + d022179 commit ea553d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ it works
crun could go much lower than that, and require \< 1M. The used 4MB is a
hard limit set directly in Podman before calling the OCI runtime.

## Depedencies
## Dependencies

These dependencies are required for the build:

Expand Down
4 changes: 2 additions & 2 deletions src/libcrun/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,7 @@ libcrun_cgroup_enter (struct libcrun_cgroup_args *args, libcrun_error_t *err)
default:
return crun_make_error (err, EINVAL, "unknown cgroup manager specified %d", manager);
}
if (LIKELY (ret == 0))
if (LIKELY (ret >= 0))
{
if (cgroup_mode == CGROUP_MODE_UNIFIED && (root_uid != (uid_t) -1 || root_gid != (gid_t) -1))
return chown_cgroups (*path, root_uid, root_gid, err);
Expand All @@ -1416,7 +1416,7 @@ libcrun_cgroup_enter (struct libcrun_cgroup_args *args, libcrun_error_t *err)
{
crun_error_release (err);
*err = tmp_err;
return ret;
return rootless;
}

if (rootless > 0 && (cgroup_mode != CGROUP_MODE_UNIFIED || manager != CGROUP_MANAGER_SYSTEMD))
Expand Down

0 comments on commit ea553d3

Please sign in to comment.