[lxc-devel] [lxc/master] cgroups: adhere to boolean return

brauner on Github lxc-bot at linuxcontainers.org
Mon Apr 13 12:40:01 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200413/a678d0e8/attachment.bin>
-------------- next part --------------
From ec4d463d0ff5b1a4c0838de0aaa5cd51d5797c8d Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Mon, 13 Apr 2020 14:39:18 +0200
Subject: [PATCH] cgroups: adhere to boolean return

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/cgroups/cgfsng.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c
index 522eb412d7..a6ee6875e3 100644
--- a/src/lxc/cgroups/cgfsng.c
+++ b/src/lxc/cgroups/cgfsng.c
@@ -1194,11 +1194,9 @@ static bool cgroup_tree_create(struct cgroup_ops *ops, struct lxc_conf *conf,
 		 * line, which is not possible once a subdirectory has been
 		 * created.
 		 */
-		if (string_in_list(h->controllers, "devices")) {
-			ret = ops->setup_limits_legacy(ops, conf, true);
-			if (ret < 0)
-				return ret;
-		}
+		if (string_in_list(h->controllers, "devices") &&
+		    !ops->setup_limits_legacy(ops, conf, true))
+			return log_error(false, "Failed to setup legacy device limits");
 	}
 
 	ret = mkdir_eexist_on_last(path, 0755);


More information about the lxc-devel mailing list