summaryrefslogtreecommitdiff
path: root/src/shared/cgroup-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/cgroup-util.c')
-rw-r--r--src/shared/cgroup-util.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c
index b0d378de5a..18cbf0412a 100644
--- a/src/shared/cgroup-util.c
+++ b/src/shared/cgroup-util.c
@@ -934,6 +934,20 @@ int cg_is_empty(const char *controller, const char *path, bool ignore_self) {
return !found;
}
+int cg_is_empty_by_spec(const char *spec, bool ignore_self) {
+ int r;
+ _cleanup_free_ char *controller = NULL, *path = NULL;
+
+ assert(spec);
+
+ r = cg_split_spec(spec, &controller, &path);
+ if (r < 0)
+ return r;
+
+ return cg_is_empty(controller, path, ignore_self);
+}
+
+
int cg_is_empty_recursive(const char *controller, const char *path, bool ignore_self) {
int r;
DIR *d = NULL;