From: Christian Brauner Date: Sat, 17 Feb 2018 18:09:18 +0000 (+0100) Subject: cgfsng: controller_list_is_dup() X-Git-Tag: lxc-3.0.0.beta1~22^2~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=258449e5962dcffd3b81eb43114e0723ccdc2359;p=thirdparty%2Flxc.git cgfsng: controller_list_is_dup() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index b67f41a81..95aa93d74 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -791,10 +791,9 @@ static bool controller_lists_intersect(char **l1, char **l2) return false; } -/* - * For a null-terminated list of controllers @clist, return true if any of - * those controllers is already listed the null-terminated list of - * hierarchies @hlist. Realistically, if one is present, all must be present. +/* For a null-terminated list of controllers @clist, return true if any of those + * controllers is already listed the null-terminated list of hierarchies @hlist. + * Realistically, if one is present, all must be present. */ static bool controller_list_is_dup(struct hierarchy **hlist, char **clist) { @@ -802,11 +801,12 @@ static bool controller_list_is_dup(struct hierarchy **hlist, char **clist) if (!hlist) return false; + for (i = 0; hlist[i]; i++) if (controller_lists_intersect(hlist[i]->controllers, clist)) return true; - return false; + return false; } /*