Skip to content

Commit

Permalink
cgroups/cgfsng: rework cgfsng_nrtasks()
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 362bcc4 commit b46a3ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lxc/cgroups/cgfsng.c
Expand Up @@ -1933,8 +1933,11 @@ __cgfsng_ops static int cgfsng_nrtasks(struct cgroup_ops *ops)
{
__do_free char *path = NULL;

if (!ops)
return ret_set_errno(-1, ENOENT);

if (!ops->container_cgroup || !ops->hierarchies)
return -1;
return ret_set_errno(-1, EINVAL);

path = must_make_path(ops->hierarchies[0]->container_full_path, NULL);
return recursive_count_nrtasks(path);
Expand Down

0 comments on commit b46a3ae

Please sign in to comment.