The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/1714
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Also: LOL Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
From 32f603989a8c6c6600407877d4d1f33c76e173f5 Mon Sep 17 00:00:00 2001 From: Christian Brauner <christian.brau...@ubuntu.com> Date: Thu, 27 Jul 2017 20:49:58 +0200 Subject: [PATCH] cgroups: workaround gcc-7 bug Also: LOL Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com> --- src/lxc/cgroups/cgfsng.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 5ad24d1e5..3a6c70caa 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1315,7 +1315,8 @@ static inline bool cgfsng_create(void *hdata) { struct cgfsng_handler_data *d = hdata; char *tmp, *cgname, *offset; - int i, idx = 0; + int i, ret; + int idx = 0; size_t len; if (!d) @@ -1341,8 +1342,11 @@ static inline bool cgfsng_create(void *hdata) ERROR("Too many conflicting cgroup names"); goto out_free; } - if (idx) - snprintf(offset, 5, "-%d", idx); + if (idx) { + ret = snprintf(offset, 5, "-%d", idx); + if (ret < 0 || (size_t)ret >= 5) + INFO("Shut up gcc-7"); + } for (i = 0; hierarchies[i]; i++) { if (!create_path_for_hierarchy(hierarchies[i], cgname)) { int j;
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel