]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgroup: make sure cg_is_empty_recursive() returns 1 for non-existing cgroups
authorLennart Poettering <lennart@poettering.net>
Thu, 3 Sep 2015 16:28:21 +0000 (18:28 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 4 Sep 2015 07:07:31 +0000 (09:07 +0200)
Previously, on the legacy hierarchy a non-existing cgroup was considered
identical to an empty one, but the unified hierarchy the check for a
non-existing one returned ENOENT.

src/basic/cgroup-util.c

index 3ef96b238e6fe45e3e6bf112e8fe8fb50f14f87e..bf897c9b2dc4d78757111d832b615e41ff3a6ab4 100644 (file)
@@ -1002,6 +1002,8 @@ int cg_is_empty_recursive(const char *controller, const char *path) {
                         return r;
 
                 r = read_one_line_file(populated, &t);
+                if (r == -ENOENT)
+                        return 1;
                 if (r < 0)
                         return r;