From: Kamalesh Babulal Date: Tue, 21 Nov 2023 08:46:47 +0000 (+0530) Subject: tools/cgset: guard systemd default delegate slice X-Git-Tag: v3.2.0~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29dfcfb6768c5168b754bfe0471a820333802fe4;p=thirdparty%2Flibcgroup.git tools/cgset: guard systemd default delegate slice Guard setting default systemd delegate slice with WITH_SYSTEMD, to limit the systemd delegation only to --enable-systemd=yes only. Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- diff --git a/src/tools/cgset.c b/src/tools/cgset.c index 51c4d144..8b1ecf3b 100644 --- a/src/tools/cgset.c +++ b/src/tools/cgset.c @@ -444,7 +444,9 @@ static int add_subtree_control_name_value(struct control_value *name_value) int main(int argc, char *argv[]) { +#ifdef WITH_SYSTEMD int ignore_default_systemd_delegate_slice = 0; +#endif struct control_value *name_value = NULL; int nv_number = 0; int recursive = 0; @@ -564,9 +566,10 @@ int main(int argc, char *argv[]) goto err; } - /* this is false always for disable-systemd */ +#ifdef WITH_SYSTEMD if (!ignore_default_systemd_delegate_slice) cgroup_set_default_systemd_cgroup(); +#endif /* copy the name-value pairs from -r options */ if ((flags & FL_RULES) != 0) {