]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups/cgfsng: rework cgfsng_nrtasks()
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 7 Dec 2019 23:41:36 +0000 (00:41 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 7 Dec 2019 23:41:36 +0000 (00:41 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index 0ce7258f0e0866998a3b1ecbd54237e3d31ea813..f6e7a9df6cbf5a0c3e2dab59dc9b518509421dd2 100644 (file)
@@ -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);