Skip to content

Commit

Permalink
cgroups/cgfsng: rework cgfsng_payload_enter()
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Dec 8, 2019
1 parent 5822233 commit 68990f1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lxc/cgroups/cgfsng.c
Expand Up @@ -1491,9 +1491,18 @@ __cgfsng_ops static bool cgfsng_payload_enter(struct cgroup_ops *ops,
int len;
char pidstr[INTTYPE_TO_STRLEN(pid_t)];

if (!ops)
return ret_set_errno(false, ENOENT);

if (!ops->hierarchies)
return true;

if (!ops->container_cgroup)
return ret_set_errno(false, ENOENT);

if (!handler || !handler->conf)
return ret_set_errno(false, EINVAL);

len = snprintf(pidstr, sizeof(pidstr), "%d", handler->pid);

for (int i = 0; ops->hierarchies[i]; i++) {
Expand Down

0 comments on commit 68990f1

Please sign in to comment.