[lxc-devel] [lxc/master] cgfsng: return attach fail if container stopped

lifeng68 on Github lxc-bot at linuxcontainers.org
Wed Nov 27 07:38:34 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 344 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20191126/a2e8b0fd/attachment.bin>
-------------- next part --------------
From e2cb2e749f132db85ed09efd047d41c6f663790f Mon Sep 17 00:00:00 2001
From: LiFeng <lifeng68 at huawei.com>
Date: Wed, 27 Nov 2019 03:59:23 -0500
Subject: [PATCH] cgfsng: return attach fail if container stopped

Signed-off-by: LiFeng <lifeng68 at huawei.com>
---
 src/lxc/cgroups/cgfsng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c
index 1e6a45cff2..2ea9cec034 100644
--- a/src/lxc/cgroups/cgfsng.c
+++ b/src/lxc/cgroups/cgfsng.c
@@ -2223,7 +2223,7 @@ __cgfsng_ops static bool cgfsng_attach(struct cgroup_ops *ops, const char *name,
 		path = lxc_cmd_get_cgroup_path(name, lxcpath, h->controllers[0]);
 		/* not running */
 		if (!path)
-			continue;
+			return false;
 
 		fullpath = build_full_cgpath_from_monitorpath(h, path, "cgroup.procs");
 		ret = lxc_write_to_file(fullpath, pidstr, len, false, 0666);


More information about the lxc-devel mailing list