Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
return i;
}
-__cgfsng_ops static bool cgfsng_get_hierarchies(struct cgroup_ops *ops, int n, char ***out)
+__cgfsng_ops static bool cgfsng_get_hierarchies(struct cgroup_ops *ops, int n,
+ char ***out)
{
int i;
+ if (!ops)
+ return ret_set_errno(false, ENOENT);
+
if (!ops->hierarchies)
return false;
/* sanity check n */
for (i = 0; i < n; i++)
if (!ops->hierarchies[i])
- return false;
+ return ret_set_errno(false, ENOENT);
*out = ops->hierarchies[i]->controllers;
return true;
}
-
static bool cg_legacy_freeze(struct cgroup_ops *ops)
{
__do_free char *path = NULL;