summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-03 18:28:21 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-04 09:07:31 +0200
commit9a66c87a2386468fd3adc250cd9003644a7a5e6b (patch)
treecff0510153f4e9202aa5b3adcca8428bb71fba6e
parentcgroup: when comparing agent paths, use path_equal() (diff)
downloadsystemd-9a66c87a2386468fd3adc250cd9003644a7a5e6b.tar.xz
systemd-9a66c87a2386468fd3adc250cd9003644a7a5e6b.zip
cgroup: make sure cg_is_empty_recursive() returns 1 for non-existing cgroups
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.
-rw-r--r--src/basic/cgroup-util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index 3ef96b238e..bf897c9b2d 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -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;