[lxc-devel] [lxc/master] cgroups: fix armhf builds

brauner on Github lxc-bot at linuxcontainers.org
Tue Aug 25 10:29:47 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 480 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200825/3dc3d5f1/attachment.bin>
-------------- next part --------------
From 9fd047d1585fb278c30ae21ce67ae145e7d8f966 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Tue, 25 Aug 2020 12:27:10 +0200
Subject: [PATCH] cgroups: fix armhf builds

Link: https://launchpadlibrarian.net/494473462/buildlog_ubuntu-groovy-armhf.lxc_1%3A4.0.4-0ubuntu2_BUILDING.txt.gz
Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/cgroups/cgfsng.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c
index 3ab041e1f9..f508c63d36 100644
--- a/src/lxc/cgroups/cgfsng.c
+++ b/src/lxc/cgroups/cgfsng.c
@@ -2217,7 +2217,7 @@ static int cgroup_attach_leaf(const struct lxc_conf *conf, int unified_fd, pid_t
 	do {
 		bool rm = false;
 		char attach_cgroup[STRLITERALLEN(".lxc-/cgroup.procs") + INTTYPE_TO_STRLEN(int) + 1];
-		char *slash;
+		char *slash = attach_cgroup;
 
 		ret = snprintf(attach_cgroup, sizeof(attach_cgroup), ".lxc-%d/cgroup.procs", idx);
 		if (ret < 0 || (size_t)ret >= sizeof(attach_cgroup))
@@ -2231,7 +2231,7 @@ static int cgroup_attach_leaf(const struct lxc_conf *conf, int unified_fd, pid_t
 		if (ret < STRLITERALLEN(".lxc-/cgroup.procs"))
 			return log_error_errno(-EINVAL, EINVAL, "Unexpected short write would cause buffer-overrun");
 
-		slash = &attach_cgroup[ret] - STRLITERALLEN("/cgroup.procs");
+		slash += (ret - STRLITERALLEN("/cgroup.procs"));
 		*slash = '\0';
 
 		ret = mkdirat(unified_fd, attach_cgroup, 0755);


More information about the lxc-devel mailing list