summaryrefslogtreecommitdiff
path: root/src/core/cgroup.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-09-27 17:54:06 +0200
committerSven Eden <yamakuzure@gmx.net>2017-11-22 08:25:11 +0100
commitb7e036edb9b4fea677bc92ca57f0c0f1efc25410 (patch)
tree9864c5b25cb59c88a6e4242875ea087a0f127932 /src/core/cgroup.h
parent9b74c28b7c2329b86d92c504c3455c178ec14e87 (diff)
core/cgroup: add a helper macro for a common pattern (#6926)
Diffstat (limited to 'src/core/cgroup.h')
-rw-r--r--src/core/cgroup.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/cgroup.h b/src/core/cgroup.h
index a7100d1fc..2d09c4cc3 100644
--- a/src/core/cgroup.h
+++ b/src/core/cgroup.h
@@ -198,7 +198,11 @@ int unit_get_ip_accounting(Unit *u, CGroupIPAccountingMetric metric, uint64_t *r
int unit_reset_cpu_accounting(Unit *u);
int unit_reset_ip_accounting(Unit *u);
-bool unit_cgroup_delegate(Unit *u);
+#define UNIT_CGROUP_BOOL(u, name) \
+ ({ \
+ CGroupContext *cc = unit_get_cgroup_context(u); \
+ cc ? cc->name : false; \
+ })
int unit_notify_cgroup_empty(Unit *u);
#endif // 0