Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crun: fix return code check for cgroupfs #409

Merged
merged 2 commits into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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